Possible Duplicate:
How to get the URL of the current page in C#
If I am in a page say http://myweb/folder/obtain.aspx?thevalue=3
, how can i determine if the url contains obtain.aspx?thevalue
in c#?. I just need to check whether the user landed on this particular page.
PS: I guess I dont really need to check for the ?thevalue
but just the obtain.aspx
Try this:
//gets the current url
string currentUrl = Request.Url.AbsoluteUri;
//check the url to see if it contains your value
if (currentUrl.ToLower().Contains("obtain.aspx?thevalue"))
//do something
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With