CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   ASP.NET (http://www.codingforums.com/forumdisplay.php?f=40)
-   -   help in querrystring? (http://www.codingforums.com/showthread.php?t=78982)

hytechpro 02-07-2006 06:00 AM

help in querrystring?
 
Hi all,

We can transfer the user input from one web page to other page by using cookies, session variables and querrystring.
Is it possible to store 2 variables in querrystring if yes plz tell how???
Incase of single I cando it as follows

Response.Redirect(“webform2.aspx?a=”+textbox1.Text);

It works well
Plz tell me what do do if I want more variables.

Thanx
Devs

Nischumacher 02-07-2006 10:11 AM

Code:

Response.Redirect("webform2.aspx?a=" + textbox1.Text + "&b=" + textbox2.text + "&c=" + textbox3.text);
here a, b, c hold the values... and can be accessed like...
Request.QueryString("a"), Request.QueryString("b"), Request.QueryString("c")... respectively

hytechpro 02-07-2006 12:29 PM

Yes i tried this but there is a problem when i access them
i am simply writing the values of a, b and c like this
Response.Write(Request.QuerryString["a"]+"\n"+Request.QuerryString["b"]);
suppose the values a=hi and b=devs
then output is like this

hi
&b=devs

required output is

hi
devs

what is wrong???




Quote:

Originally Posted by Nischumacher
Code:

Response.Redirect("webform2.aspx?a=" + textbox1.Text + "&b=" + textbox2.text + "&c=" + textbox3.text);
here a, b, c hold the values... and can be accessed like...
Request.QueryString("a"), Request.QueryString("b"), Request.QueryString("c")... respectively


Nischumacher 02-07-2006 01:15 PM

it is Request.QueryString["a"]...
NOT Request.QuerryString["a"]...


All times are GMT +1. The time now is 08:56 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.