Thursday, March 22, 2012

take only the "number" from QueryString - how?

hi,

i have a stored procedure witch returns details about a picture and wich have an input parameter (PictureID)

the page is something like this "Picture.aspx?PictureID=5"

how can i take only the 5 from the Rrequest.QueryString["PictureID"] to use it as input parameter to stored procedure?

thanks

Are you asking how to get the value from the querystring, or how to give it as a parameter to your sproc?

Getting the value is simple. Convert.ToInt32(Request.QueryString["PictureID"])


Hello zuperboy,

Use in the page_load event:

int PictureId = Convert.ToInt32(Request.QueyString["PictureID"]);

Set PictureId as the input parameter of the stored procedure. I guess you know how that part works.

Jeroen Molenaar.


thank you to you two, this was easy:P

0 comments:

Post a Comment