Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I want to pass multiple string values from one aspx page to another aspx page.
I am able to send one value but how to pass multiple values at the time when the page is redirected from one page to another page.

For example : string s = "ABC";
string s1 = "PQR";
string s2 = "LMN";

I am able to pass one value like this : Response.Redirect("~/PrintBilledReport.aspx?sentence=" + s);

I want to send all s,s1 and s2 from one page to another page. Please tell me the proper format how to pass the multiple values from one page to another page.

Thanks in advance...
Posted

 
Share this answer
 
Comments
rp786 24-Dec-12 2:46am    
Thanks it worked..
__TR__ 24-Dec-12 3:02am    
You're welcome.
UDTWS 15-Apr-19 6:36am    
is their any other process to pass values without using querysting or session.
Instead of using session I would suggest you to use QueryString only. Just have a look below:
In Page 1:
C#
Response.Redirect("~/PrintBilledReport.aspx?sentence="+s+"&word="+s1+"&letter"+s3);

In Page 2:
C#
string s1 = Request.QueryString["sentence"];
string s2 = Request.QueryString["word"];
string s3 = Request.QueryString["letter"];

Now you can use the string variables in 2nd page.

--Amit
 
Share this answer
 
Comments
rp786 24-Dec-12 2:46am    
Thanks all of you. The solutions worked.
__TR__ 24-Dec-12 3:02am    
My 5!
_Amy 24-Dec-12 3:09am    
Thank you Tejas.. :)
UDTWS 15-Apr-19 6:36am    
is their any other process to pass values without using querysting or session.
on First page :
C#
string s = "ABC";
string s1 = "PQR";
string s2 = "LMN";

Session["s"] = s;
Session["s1"] = s1;
Session["s2"] = s2;


On Second page :
C#
string str, str1, str2;

str = Session["s"].ToString(); 
str1 = Session["s1"].ToString(); 
str2 = Session["s2"].ToString(); 
 
Share this answer
 
Comments
UDTWS 15-Apr-19 6:36am    
is their any other process to pass values without using querysting or session.

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