Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I wanted to connect 2 pages using the ID from the database, the id is set to increment automatically...

I wanted to pass the value of the id through the URL and query string.

Can anybody help me with this please !
Posted

Something like this:-

MyPage.aspx?id=xxx&name=yyy
 
Share this answer
 
Try this:
To pass value in query string:
Response.Redirect("Item.aspx?Id=1");

To get value from query string:
For string:
String Id = Request.QueryString["Id"].ToString();

For int:
int id= Convert.ToInt32(Request.QueryString["Id"]);

Also, have a look on following thread:
Passing variables between pages using QueryString[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900