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 ...