How do I pass TWO parameters in Response.redirect ?

A

Alex Nitulescu

Hi.

I have tried to pass two parameters, like this:

Response.Redirect(String.Format("NewPage.aspx?Username={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
 
S

Steve C. Orr [MVP, MCSD]

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.
 
A

Alex Nitulescu

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top