Possible Duplicate:
How to read parameter passed from asp.net page, using C#?
I want to display profile contents on a ASP.NET web page based on the user id which is displayed at the end of a the URL, as in a facebook page.
I want to be able to derive the id from the URL just so I can search the database to match the Id.
If someone could help me derive the Id which is the last bit of the URL, I could convert that to a string and do the rest.
Help on this is much appreciated.
Thank You
This will depend on how you’re programming and the structure of your URL.
Example;
If the URL is something similar to http://mydomain.com/page.aspx?id=1 you can read the querystring by doing the following.
In this instance the value of strID would be 1.
Are you using URL rewrite modules or simple Web Forms?