Forum Moderators: open

Message Too Old, No Replies

Getting id= from url in ASP.NET C#

         

adrianbromfield

3:25 pm on Feb 28, 2008 (gmt 0)

10+ Year Member



Hi guys, im fairly new to ASP.NET and its totally got my baffled to say the least, I cant seem to find anything on the net, maybe im searching using wrong terms so does anybody know how to retrieve a GET variable from a URL in ASP.NET using C#?

say for example default.aspx?id=5

how would i get the id value?

request("id") brings back an error so im guessing that cant be used anymore.

Any help would really be appreciated,

Thanks,

Adrian

andyll

9:19 pm on Feb 28, 2008 (gmt 0)

10+ Year Member



Request.QueryString["id"];

adrianbromfield

10:20 am on Feb 29, 2008 (gmt 0)

10+ Year Member



thanks.. :D cant believe i had the wrong type of brackets!