Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Newbie: Request

Reply
Thread Tools

Newbie: Request

 
 
Scott
Guest
Posts: n/a
 
      02-19-2009
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


 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      02-19-2009
Scott wrote:
> 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.


--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      02-19-2009
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! |
*************************************************

"Scott" <(E-Mail Removed)> wrote in message
news:##(E-Mail Removed)...
> 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
>

 
Reply With Quote
 
wjfamilia
Guest
Posts: n/a
 
      02-19-2009
I would recommend you look into the Wizard control.

--
William J. Familia


"Mark Rae [MVP]" wrote:

> "Scott" <(E-Mail Removed)> wrote in message
> news:%23%(E-Mail Removed)...
>
> > I am still learning ASP

>
> In fact, you're not - you're learning ASP.NET...
>
> ASP is (generally) taken to refer to ASP Classic...
>
> > and having an issue.
> > Suppose I have 2 aspx 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.

>
> The Request.UrlReferrer class gives information about the page from which
> the current page was redirected.
>
> However, this cannot be relied upon at all, especially when running on the
> public Internet:
> http://www.google.co.uk/search?sourc...UrlReferrer%22
>
> The only guaranteed way of doing this is by passing the name of the page
> either as part of the Request, in the QueryString, in a Session variable
> etc...
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Just got two emails: 1. your request for a new Access Code and 2. Request for my MCP ID# What's going on??!! belfast-biker Microsoft Certification 0 01-14-2006 12:49 PM
Re: Accessing Request.InputStream / Request.BinaryRead *as the request is occuring*: How??? Brian Birtle ASP .Net 2 10-16-2003 02:11 PM
best way to get data: request.form, request.params, controlname.value Christian H ASP .Net 1 07-29-2003 05:27 AM
Re: difference bet. request.querystring and Request.Params Daniel Bass ASP .Net 2 07-04-2003 12:12 PM
System.Web.HttpException: Request timed out - [HttpException (0x80004005): Request timed out.] Steve ASP .Net 0 07-01-2003 12:11 AM



Advertisments