Which page has called a page


Is a page able to know which page has called it ?
If Page_A and Page_B can call Page_C, I would want to know during Page_Load of Page_C if it is Page_A or Page_B which is the calling page ?
12/11/2003 6:27:00 AM
asp.net.web-forms 93655 articles. 6 followers. Follow

4 Replies

Similar Articles

[PageSpeed] 3

You could try using Request.UrlReferrer. This will give you the complete url, type:

To strip away everything unecessary like Querystrings etc. you could use something like this:

Dim strReferrer As String = Request.UrlReferrer.ToString
Dim intStart As Int32 = strReferrer.LastIndexOf("/") + 1
Dim intLength As Int32 = (strReferrer.LastIndexOf("?") - 1) - strReferrer.LastIndexOf("/")
strReferrer = strReferrer.Substring(intStart, intLength)

This will give you 'Employees.aspx' only.

Andre Colbiornsen
Seventh Day
Råbygatan 1A,
SE-223 61 Lund
Mob.: +46-(0)708-97 78 79
Mail: info@seventhday.se
12/11/2003 8:39:45 AM
Try using the "sender" in the Page_Load.  It doesn't seem to hold a value, but I have noticed in debug mode that it is a type representing the refering page (i.e. 'ASP_PageName_aspx').

12/11/2003 9:12:05 AM
Using sender will give you the name of the page which runs the Page_Load handler, not the referring Page.

Andre Colbiornsen
Seventh Day
Råbygatan 1A,
SE-223 61 Lund
Mob.: +46-(0)708-97 78 79
Mail: info@seventhday.se
12/11/2003 9:13:45 AM
Response.Redirect("c.aspx?iam=a"); ?

Lostinet (Li Jian Dai) .NET MVP

http://www.lostinet.com/ for LWTree/DatePicker

http://www.contextboundmodel.net/ for AOP.NET
12/11/2003 1:06:34 PM

Similar Artilces:

Can my web page with a form submit to other web pages forms?
I was wondering if I created an aspx page that had a form on it that I could use the submit button to submit this form's contents to other web pages forms(servers accepting those form's data). I am thinking this would be a great way to update data on particular web pages without having to actually visit those similar web pages. Any ideas, examples would be much appreciated. Thanks in advance.  Yes you can.  It's called Cross Page Posting: http://msdn2.microsoft.com/en-us/library/ms178139.aspxAlso: http://msdn2.microsoft.com/en-us/library/ms178140.aspx might ...

In a web page(c#), I want to call another page and come back to next instruction of calling page
In a web page(c#), I want to call another page and come back to next instruction of calling page. Called page have no web item , it has only c# codes. after executing of this page (by IExplore), I want the remaining lines of calling page to be executed. How can I do that? What are you trying to do? What is the second page accomplishing? Will the first page stay open and the second page closes? You might be able to use WebRequest and WebResponse to do what you want. Hey bro, since you say that the called page has no web items, why dont you put the code in the called pa...

Paging Paging Paging
I am trying to do paging with my search results and it isnt working very well. Here is what I've tried and I feel I've tried everything, lol, please help me out. Sub DataGrid1_SortCommand(Sender as object, e as DataGridSortCOmmandEventArgs) DataGrid1.DataBind() End Sub Sub Datagrid1_PageIndexChanged(Sender as object, e as DataGridPageChangedEventArgs) Dim ds as dataSet DataGrid1.CurrentPageIndex = e.NewPageIndex if Session("Search") is nothing then 'Session probably has expired, get the datasource from database Datagrid1.DataSource = ...

how to open a web page in form of a popup web page
Hello, I have two web pages, let say. Page A : With a Button on it. PAge B: with some info. Now I need to: When I click on the Button of page A.Page B must open in a pop up window.  I can do this but problem is this when I clicked on the button for first time it does not show me any thing and when I clicked on the button for second time then It shows me Page B .My code is as follow:  1 protected void Page_Load(object sender, EventArgs e) 2 { 3 if (!this.Page.IsPostBack) 4 { 5 6 } 7 else 8...

All web pages hang on web server when one of the web pages calls a run away sql query
Hi: We have a Windows 2003 dedicated web server running the .NET Frameworks 1.0 and 2.0.  We have a SQL Server cluster running SQL Server 2000.  Unfortunately, we do not have a test environment.  I have 2 .NET web sites in production.  My coworker has a voting .NET web page using AJAX on the same server.  The coworker wrote a query that was not indexing properly and when the page fired the query...the cluster went to almost 100% utilization.  My two web pages would hang and show a blank white page on the default.aspx.  Neither of m...

A page can have only one server-side Form tag
I have a web user control in my web page.  The user control (ascx) consist of a text box and button. The web page consist of text boxes and buttons also.  Both pages have form tags with runat=server.  When I run the web page it comes up with the error "A page can have only one server-side Form tag." Both the user control and web page need the form tag with runat=server.  Is there a way I can code these pages where there won't be a conflict between the web user control and the web page? Thanks   JohnMo wrote:Both the user control and web page need the form tag wit...

When Press F5 in my web page, it is making fresh call to the page and IsPostBack is false though after many click on button on same page
HI,  I am Using .net 3.5 and vs 2008. In my project there is a Master page also. Actually my problem is. when navigate to the Page say "Home.aspx",  IsPostback is false and relevant code is executed. After that Button1 is clicked in home page, this time IsPostback is true and corresponding code and Button1_click code is executed. In this situation F5 is pressed, as per the aspx lifecycle IspostBack is true and Button1_click must be executed. but in my case it is pretty diffrent, i.e IsPostback  is false and page is loading freshly as firstime request to the...

how to know the calling page from called page.
hi, i need to know how to get the calling page from the called page even there is no post back has been done. Look at the ServerVariables, in particular the Referer i am having the linkbutton in the previous page called page1. while clicking the button the page is redirect to the current page called page2. now i want to know the name or url of the page1. how can i do???? As I already said.... HttpContext.Current.Request.ServerVariables("HTTP_REFERER") Thank You so much... it works very well.......

how to navigate the url page in one web application page to another web application page
In my project one solution have 2 web apllications in one folder.like 1.webapplication1 2.webapplication2. in firt webapplication1 i created one aspx page like sample.axpx. in second webapplication2 i created one aspx page like sample2.aspx... in sample2.aspx page have hyperlinl. I need to navigate this hyperlink when i click it go to the sample.axpx. how can i write navigate url for this...help me. ..thanks  As i understand u, you need Multi Project soltuionsee this link, http://community.rainbowportal.net/blogs/jonathans_rainbow_blog/archive/2006/02/19...

Could PB .NET Web Form POST security Information to others web page??
This is a multi-part message in MIME format. ------=_NextPart_000_00F9_01C9C4D5.8FB45C90 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: quoted-printable Hi,=20 Have anyone came across the requesion to POST security informations from = PB .NET web form web page to other web site?? I have tried many datys, Could any kind man give me some suggessions?? thanks & Best regards Leon ------=_NextPart_000_00F9_01C9C4D5.8FB45C90 Content-Type: text/html; charset="big5" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML P...

difference of calling web services and calling web page
Dear all,  What is the difference of call a web services instead of calling a aspx page which is also programming can accept parameters and return results? Webservice -- Soap protocol Webapplication  -- HTTP protocol Webservices are of two Major types Xml & SOAP HttpWebServices Basic difference is in usage and implementation. We use a webservice inside a website. it is added as a reference or we can call it through HttpWebRequests and Response objects. Webpages are the components that have presentation and logic, while web services provide the service that we...

Web page opens second web page, how does first page know when the second one closes?
I have an app written in ASP.NET where one of the web pages opens up a web page in a second window.  When this second web page closes, the first web page needs to update its data.  How do you do this? You can have the child window call a parent method when the user clicks a link to close it. Otherwise, you'd have to set up polling to check for the existence of the child, and refresh if it doesn't exist. Please Mark As Answer posts that helped you."If we learn from our mistakes, I should be brilliant by now." Thanks, this gives me part of the answer...

Page To Page
Hi How can i call to a Text that has been written in a different page(in a TextBox). I want to call him to make a SELECT quastion. Thank's....

page up / page down
Name: Kyle Morrison Email: kymorris_at_cisco.com Product: Deer Park Summary: page up / page down Comments: page up and page down do not work mac osx 10.3.9 Browser Details: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b3) Gecko/20050712 Firefox/1.0+ ...

Web resources about - Which page has called a page - asp.net.web-forms

A Horse Called Music - Wikipedia, the free encyclopedia
A Horse Called Music is a 1989 album by country singer Willie Nelson . The album includes Nelson's last number 1 single, "Nothing I Can Do About ...

Unsportsmanlike Conduct Called On Replacement NFL Ref Due To Facebook Posts
One of the National Football League ’s replacement officials was removed from his assignment to work the New Orleans Saints ’ visit to the Carolina ...

Today Show - We're kicking off a series called "Love Your... - Facebook
We're kicking off a series called "Love Your Selfie" that will examine the current obsession with body image and what we can do to feel more ...

Some guy called Paul (@MonkeyBoy1138) on Twitter
Log in Sign up You are on Twitter Mobile because you are using an old version of Internet Explorer. Learn more here Some guy called Paul @ MonkeyBoy1138 ...

Scripting News: He called the President 'boy'.
... I'm used to people saying something that's not always true, but just keep on repeating it and ultimately hoping I'll believe it." He called ...

There's a Reason It's Called "Venture" Capital
I meet a lot of entrepreneurs. In general, they tend to fit into two categories.The first type is looking for a quick win. They&rsquo;re doing ...

Coach.me - Accountability, Tracking and Coaching for Any Goal or Habit (Formerly Called Lift) on the ...
Get Coach.me - Accountability, Tracking and Coaching for Any Goal or Habit (Formerly Called Lift) on the App Store. See screenshots and ratings, ...

So-called bust of Sulla, Augustan copy of an original of the late 2nd century B.C., Glyptothek, Munich ...
So-called “Sulla”, free copy (probably from the time of Augustus) after a portrait of an important Roman from the 2nd century BC. Because of ...

Federal authorities being called on to end the Stop & Frisk program ! - YouTube
Manhattan borough president, a state senator, along with civil rights advocates call on federal authorities to step in to keep minority New Yorkers ...

Amazon's 7-figure deal to buy a movie called "Wiener-Dog" shows major shift in its thinking
Amazon just signed a 7-figure deal to buy the rights to a movie called "Wiener-Dog," a comedy film directed by Todd Solondz, whose previous work ...

Resources last updated: 1/28/2016 8:22:43 PM