I want to perform certain actions whenever a menu LinkButton is clicked on, but only navigate to a page if the user isn't already there. In short, I'm using Response.Redirect in the code-behind to navigate after running my necessary code. My menu filters the content on my home page, and also navigates back to the home page if the user is elsewhere when they click on one of the filter LinkButtons. I only want to navigate back to the home page if the user is somewhere else to maintain the Ajax functionality on the home page.
I could use HttpContext.Current.Request.Url.ToString() to grab a string representation of the url, strip off the last part and compare that to the home page, then navigate or not depending on the result. However, since the url returned has the complete path and names might occur more than once within separate folders, I hesitate to use this option. For the home page it might work, because I can't imagine a good reason for placing Default. ...
Go to the complete details ...