-
Page Name in ASP
How can I get the page's name with visual script ???
-
Re: Page Name in ASP
look at the servervariables collection, it has a method that returns the
script name
Regards
John Timney (MVP)
Char <anguetax@hotmail.com> wrote in message news:38f1ee8a@news.devx.com...
>
> How can I get the page's name with visual script ???
-
Re: Page Name in ASP
"Char" <anguetax@hotmail.com> wrote:
>
>How can I get the page's name with visual script ???
Hi,
Here it is.
<%= Request.ServerVariables("Script_Name")%>
It will return the page name with the path. It's very easy to parse out what
you want.
Zhou Hao
-
<%
Dim strPage
strPage= Request.ServerVariables("SCRIPT_NAME")
strPage= Right(strPageName,Len(strPage) - InStrRev(strPage,"/"))
%>
This will grab JUST the page name, no directories.
-
Correction
Excellent script thanks RCarlson, however it had a couple of errors. Here's the correct version:
<%
Dim strPage
Dim strPageName
strPageName= Request.ServerVariables("SCRIPT_NAME")
strPage= Right(strPageName,Len(strPageName) - InStrRev(strPageName,"/"))
%>
-
Correction to your "correction"
 Originally Posted by justinmoss
Excellent script thanks RCarlson, however it had a couple of errors. Here's the correct version:
<%
Dim strPage
Dim strPageName
strPageName= Request.ServerVariables("SCRIPT_NAME")
strPage= Right(strPageName,Len(strPageName) - InStrRev(strPageName,"/"))
%>
Actually, there are no errors in RCarlson's code. In fact, his is more efficient than yours since he doesn't unnecessarily create another variable.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks