Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to pass more then one value through responce.redirect or how to pass more then one values from one page to another page through responce.redirect
Posted
Comments
[no name] 5-Oct-15 2:31am    
Can give an example what you are passing now and what you need?
Member 11973254 5-Oct-15 2:36am    
here is code for one value
protected void LinkButton1_Click(object sender, EventArgs e)
{
string id = (string)(Session["TID"]);
Response.Redirect("print_page.aspx?TID=" + id);
}
and i dont knw how to pass 2nd value that is PAID

C#
//On page 1:
Response.Redirect("pagetwo.aspx?name=ABC&age=99");

//On page 2:
var name =  Request.QueryString["name"];
var age = Request.QueryString["age"];

Passing variables between pages using QueryString[^]

-KR
 
Share this answer
 
You can pass multiple values as query string using Response.Redirect() method as
C#
protected void LinkButton1_Click(object sender, EventArgs e)
{
string id = (string)(Session["TID"]);
string paid = (string)(Session["PAID"]);
Response.Redirect("print_page.aspx?TID=" + id+"&PAID="+paid);
}

Use "&" to add the query string parameter.
 
Share this answer
 
Use below sample

C#
Response.Redirect("Page.aspx?Param1="+txtParam1.Text+"&Param2="+txtParam2.Text);
 
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