Newbie: Request

S

Scott

Hi,
I am still learning ASP, and having an issue.
Suppose I have 2 asp forms. Form1.aspx and Form2.aspx.
From Form1.aspx I am calling Form2.aspx like this
response.redirect("Form2.aspx?ID=11")

Now from Form2.aspx I want to know from which page I am getting this request
or which page is asking for this request. In this example it should be
Form1.aspx.
Is there any way doing this.

Thanks,
Scott
 
M

Martin Honnen

Scott said:
Hi,
I am still learning ASP, and having an issue.
Suppose I have 2 asp forms. Form1.aspx and Form2.aspx.
From Form1.aspx I am calling Form2.aspx like this
response.redirect("Form2.aspx?ID=11")

Now from Form2.aspx I want to know from which page I am getting this request
or which page is asking for this request. In this example it should be
Form1.aspx.
Is there any way doing this.

Request.UrlReferrer
should give you the complete URL (e.g.
http://example.com/dir/Form1.aspx) as an Uri object where can then
extract what you are looking for.
 
C

Cowboy \(Gregory A. Beamer\)

Just to be sure you are learning ASP.NET properly, I have a question?

Why are you linking forms in this manner? Is it to have a multipage submit?

If so, you are better to use a Wizard control, a set of panels, or similar
rather than submit and pass. Then everything you need for the final submit
sits in one page, even if the user cannot see it visibly. Much easier to
control and more ASP.NET like.

In classic ASP, it was quite common to have multiple forms. In ASP.NET, the
form should encapsulate the user interface for the entire use case - at
least in most instances.
 

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

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top