Posted on: 5/27/2014 6:44:05 PM | Views : 328

I'm trying to detect if the user is on the site's homepage or not. 
This code works but wonder if there's a built-in way of root homepage detection in ASP.NET? 
string CurrentPage = Request.ServerVariables["SCRIPT_NAME"].ToLower(); if (CurrentPage.IndexOf("/default") == 0 || CurrentPage == "/") { Response.Write("we're on homepage"); } Looking for tips/suggestions/more elegant code. Thanks! 

Go to the complete details ...