I have looked everywhere for a tutorial on this how do I go about making a aspx page that I pass an ID for a item into so the url would be item.aspx?id=1042 and it would display data from sql database for item #1042. Does anyone have any information on how I do this, any articles or tutorials would be wonderful.
3 Answers
You don't really need a tutorial. Just use the Request.Querystring property like this:
int id = int.Parse(Request.Querystring("id").ToString());
// then use the id int in a db query
Good luck!
1 Comment
atrljoe
I believe it should be int id = int.Parse(Request.QueryString["id"].ToString());