473,406 Members | 2,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to get the previous page url or name?

KK
In ASP.NET is it possible to get the name of the
previous page? for example,

Page1.aspx
Page2.aspx

From page1.aspx, I do a Server.Transfer(Page2.aspx),
Now within Page2.aspx can I get the name of Page1.aspx
(the previous page who called page2.aspx) ?

Nov 18 '05 #1
2 10757
Context.Handler

Eliyahu

"KK" <kk@kk.com> wrote in message
news:eK**************@tk2msftngp13.phx.gbl...
In ASP.NET is it possible to get the name of the
previous page? for example,

Page1.aspx
Page2.aspx

From page1.aspx, I do a Server.Transfer(Page2.aspx),
Now within Page2.aspx can I get the name of Page1.aspx
(the previous page who called page2.aspx) ?

Nov 18 '05 #2
Use Request.UrlReferrer to get an uri to the page that referred to the
current page. If you use this on a page that will perform postbacks you
will have to get the referrer url if(!IsPostBack) and store it in the
viewstate. Otherwise the referrer information will be lost after the
first postback.

Use Context.Request.UrlReferrer if you are making a custom web control
and not code behind for a page.

/Hugo

KK wrote:
In ASP.NET is it possible to get the name of the
previous page? for example,

Page1.aspx
Page2.aspx

From page1.aspx, I do a Server.Transfer(Page2.aspx),
Now within Page2.aspx can I get the name of Page1.aspx
(the previous page who called page2.aspx) ?

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: george | last post by:
Can anyone help? I query a database and return a result on the column "reference". There might be 7 listings. Each row is displayed in a table, with links through to a detail page. I am working...
4
by: erik | last post by:
Is it posssible to inherit the previous pages (parent pages) background image? Is there a script out there I could look at? Thanks
1
by: Mark ??;-\) | last post by:
I would like to display a listing of files on a web page as follows: If there is only one file: display the section name and then display the current file. If there is more than one file (for...
2
by: Jason Zhou | last post by:
Hi, I have a question on how to get the previous url in custom error file. Here is what I am doing: If someone visit my website with a wrong file name or wrong directory name, IIS will...
2
by: ABC | last post by:
How to I know the previous page is clicked to forward the current page? As our web site have many methods to enter the web page, I need to know the users clicked which link or which part of...
2
by: theWizard1 | last post by:
Using Visual Studio.Net 2005, Asp.Net 2.0, and trying to use technique shown in the Programming Asp.Net 3rd Edition by O'Reily, page 257. On the first page, this would become the previous page, I...
1
by: Reb | last post by:
Hi all, I have not successfully found a Javascript sample for getting next and previous links from a file... I figured that someone must have solved this problem already! ... here is what I'm...
3
by: md9108 | last post by:
I have a previous page and next page coded. The next page works. The previous page gives me an http: 404 error and I can't figure it out. The error is on the line "<td align=left> <!-- ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.