By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,827 Members | 2,195 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,827 IT Pros & Developers. It's quick & easy.

How do I pass TWO parameters in Response.redirect ?

P: n/a
Hi.

I have tried to pass two parameters, like this:

Response.Redirect(String.Format("NewPage.aspx?User name={0}, Pass={1}",
txtUserName.Text, txtPass.Text))

But if I pass Username="Alex" and Pass="AAA", I get Params("Username") =
"alex, Pass=AAA" and Params("Pass")="", which is not what I expected.

Yes, I know that the pass should NOT be passed like this, but this is just
an exercise.

Thank you.
Alex
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
The correct syntax is this:

NewPage.aspx?UserName=Bill&Password=Gates&Whatever =4

The first parameter must have the question mark prefix, and the rest of the
parameters must use the ampersand prefix.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Alex Nitulescu" <RE***********************@yahoo.com> wrote in message
news:OV**************@tk2msftngp13.phx.gbl...
Hi.

I have tried to pass two parameters, like this:

Response.Redirect(String.Format("NewPage.aspx?User name={0}, Pass={1}",
txtUserName.Text, txtPass.Text))

But if I pass Username="Alex" and Pass="AAA", I get Params("Username") =
"alex, Pass=AAA" and Params("Pass")="", which is not what I expected.

Yes, I know that the pass should NOT be passed like this, but this is just
an exercise.

Thank you.
Alex

Nov 19 '05 #2

P: n/a
Thank you, Steve, I have searched the net and the MSDN... high & low.
Finally I just discovered it through trial & error, a few minutes ago :-((((
Thanks a lot, anyway.
Alex.
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:ug**************@TK2MSFTNGP11.phx.gbl...
The correct syntax is this:

NewPage.aspx?UserName=Bill&Password=Gates&Whatever =4

The first parameter must have the question mark prefix, and the rest of
the parameters must use the ampersand prefix.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Alex Nitulescu" <RE***********************@yahoo.com> wrote in message
news:OV**************@tk2msftngp13.phx.gbl...
Hi.

I have tried to pass two parameters, like this:

Response.Redirect(String.Format("NewPage.aspx?User name={0}, Pass={1}",
txtUserName.Text, txtPass.Text))

But if I pass Username="Alex" and Pass="AAA", I get Params("Username") =
"alex, Pass=AAA" and Params("Pass")="", which is not what I expected.

Yes, I know that the pass should NOT be passed like this, but this is
just an exercise.

Thank you.
Alex


Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.