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

Transferring Form Field values to "page 2"

P: n/a
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.

Feb 5 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
G
post via GET.

Meh, twat.

Anyway, any help appreciated.

G.
Feb 5 '07 #2

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

G.

Feb 5 '07 #3

P: n/a
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

"G" wrote:
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.
Feb 5 '07 #4

P: n/a
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)

G wrote:
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.
Feb 5 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.