Newbie: Request

  • Thread starter Thread starter Scott
  • Start date Start date
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
 
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.
 
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.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Blog:
http://feeds.feedburner.com/GregoryBeamer

*************************************************
| Think outside the box! |
*************************************************
 
Back
Top