Finding the superior page from a nested page...

J

John Sedlak

Hello, in one of my pages I have an include:

<!--#include file="console.aspx" -->

Now...Inside console.aspx, I want to be able to find the
name of the page that included it. This is because I
include console.aspx in every page...

Thank you!
 
S

Steve C. Orr [MVP, MCSD]

The most common replacement for old fashioned include files are web user
controls.
They basically are like object oriented include files on steroids.

Then from within your control you can access information about the parent
page by using the "Parent" object.

Here's more info:
http://msdn.microsoft.com/library/d...n/html/vbconintroductiontowebusercontrols.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vboriwebusercontrols.asp
http://msdn.microsoft.com/library/d...l/vbconWebUserControlsVsCustomWebControls.asp
 
J

John Sedlak

Thanks. But I am still confused at how to get the actual
url/filename of that page.
 
A

Axel Dahmen

You can get such information from the Request object, e.g. Request.Path,
Request.FilePath or something like that.

HTH,
Axel Dahmen


---------------------------------
 
A

Axel Dahmen

You can get such information from the Request object, e.g. Request.Path,
Request.FilePath or something like that.

HTH,
Axel Dahmen


---------------------------------
 
J

John Sedlak

THANK YOU ALL!
You have been a great help to me. I am loving ASP.NET! I
can't wait until I get to college...
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top