Transferring Form Field values to "page 2"

G

G

Hello,

I have a "two page form" - Page1.aspx and Page2.aspx.

I have a function in my Page1.cs file called Button_Click.

A simple version:
************************
if (Page.IsValid)
{
Response.Redirect("page2.aspx?FirstName=" + FirstName.Text + ");
}
************************
FirstName is a form field on page 1. The redirect works fine, however I
would prefer that the form values from page 1 did not appear in the URL of
page 2:

For example it currently looks like this:
page2.aspx?FirstName=Gary

Using classic ASP, I would normally use client side validation and then
SUBMIT USING POST TO page2. With .NET the page submits to itself and then
redirects to Page2 and this is similar to a post via GET. What is the best
way to hide the querystring?

Regards,

Gary.
 
G

G

I have just looked at Server.Transfer and it seems like a good method for
this task...
Might give it a bash.

G.
 
G

Guest

Hello G,

are you using ASP.NET 2.0? Wizard or MultiView control can help you to do
this in one page. In other case you can always use Session to store values
from first page or Server.Transfer to access page2 without round trip to
client = with current request.

Regards,
Ladislav Mrnka
 
B

bruce barker

use Server.Transfer, or use client script like in asp. client script can
change to form action to the new url. you could also create a second
form (after the main one) for use by client script.

-- bruce (sqlwork.com)
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top