473,804 Members | 3,108 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

get the name of the current page

JT
is there a command in asp to get the name of the current page?

furthermore, is there a way to retrieve the name of the current page within
an 'included' file (not the name of the included page, but the name of the
page that is including the file)?

i hope im making sense

thanks for the help
Jul 19 '05 #1
3 2034
Take a look at the server variables that are available to you:

<%
For each q in Request.ServerV ariables
Response.Write q & " = " Request.ServerV ariables(q) & "<hr>"
Next
%>

Ray at work

"JT" <je******@sppin c.net> wrote in message
news:eM******** ******@TK2MSFTN GP09.phx.gbl...
is there a command in asp to get the name of the current page?

furthermore, is there a way to retrieve the name of the current page within an 'included' file (not the name of the included page, but the name of the
page that is including the file)?

i hope im making sense

thanks for the help

Jul 19 '05 #2
Hi,

If you want just the name of the current file:

request.serverv ariables("PATH_ INFO")

If you want the whole URL to the file returned:

xyz = "http://" & request.serverv ariables("LOCAL _ADDR") & _
request.serverv ariables("PATH_ INFO")

HTH.

JT, on Thu, 15 Jan 2004 09:54:53 -0600, had to say:
is there a command in asp to get the name of the current page?

furthermore, is there a way to retrieve the name of the current page within
an 'included' file (not the name of the included page, but the name of the
page that is including the file)?

i hope im making sense

thanks for the help


Jul 19 '05 #3
http://www.aspfaq.com/2072

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"JT" <je******@sppin c.net> wrote in message
news:eM******** ******@TK2MSFTN GP09.phx.gbl...
is there a command in asp to get the name of the current page?

furthermore, is there a way to retrieve the name of the current page within an 'included' file (not the name of the included page, but the name of the
page that is including the file)?

i hope im making sense

thanks for the help

Jul 19 '05 #4

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

Similar topics

4
1768
by: Ben R. | last post by:
Hello, I've got a text-based .inc file that I'm using for my asp.net site's header. I thought about a user control, but if possible, I'd like to avoid it for simplicity's sake. In the main page, I do a response.writefile("header.inc") for inserting the header. I have one render block: <%= User.Identity.Name %> Unfortunately, it seems that this is outputted as literal text to the browser. I've tried a user control, but it doesn't seem...
4
2173
by: Manuel Lopez | last post by:
Hello, I need to know on evry request the page name, my problem is when use the method server.transfer, i always get the name of the calling page. I use context.Current.Request.Url, but I am always getting the first page. Is there a way to get the name of the transfered page?
4
5973
by: Nick | last post by:
I'm developing an intranet app, and want to get the current user name for logging purposes. I've turned off anonymous access, and turned on windows authentication in the IIS config. The apps web.config file has authentication mode set to windows, and 'identity impersonate' is set to true. When I try and get the default.aspx page, IE returns an error page with an 'Access is denied.' error. (Even if I try direct from the webserver, logged...
3
11591
by: Developer in California | last post by:
I am working on developing a generic Web framework using Master Pages in ASP.NET 2.0. What I have done is created a PageRenderer class which has a public method which will retrieve the path of the content I want to execute based on the name of the asp:Content control. As shown in the code snippet below, to get the content I want to display, I call the GetContentPagePath public method in PageRenderer passing a string duplicating the value...
2
2429
by: Kevin Blount | last post by:
I have an issue with trying to add a new name-pair to an existing cookie. Here's what I want to do: page1 - adds "loggedin=true" to cookie "Communities" adds "member_id=100" to cookie "Communities" page2 - adds "banner=1" to cookie "Communities"
2
7105
by: Abraham Andres Luna | last post by:
hello everyone, does anyone know why i can't access the HttpContext.Current.User.Identity.Name property in a .cs file? this is the index.aspx page: <%@ Page Language="C#" %> <script runat="server"> void Page_Load(Object Sender, EventArgs E) {
4
10184
by: Doogie | last post by:
Hi, I am using HttpContext.Current.User.Identity.Name to get a user id from a web application. I then use that as part of a name of a cookie I'm writing. 30 minutes later I do a refresh of this page and try to access that cookie. However, because I am using HttpContext.Current.User.Identity.Name to get the user id to know what that cookie name even is, I am having problems because apparently after 30 minutes...
11
6534
by: greg | last post by:
Hi all, Is there a way to get the current theme name at design time? I'm trying to write a custom control for which I need to use images from the current theme. I have asigned a theme to the page as well as in the web.config. The control looks ok at run time but when viewed in the Visual Studio designer it cannot pick up the current theme.
2
3242
by: ismailc | last post by:
Hi, I need help please. I have a page with a stylesheet that is read from an aspx form. On the form I have an hyperlink object - which iIwant the Targeturl to open within the current frame where the hyperlink object is in. I read that i need to set it in my target="frame name" but i don't know what the current frame name is. or any other idea on how i can open the hyperlink's Targeturl within the current frame.
0
9575
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10320
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10308
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10073
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9134
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6846
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5645
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3806
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2981
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.