Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to retrieve current page name

Reply
Thread Tools

How to retrieve current page name

 
 
Valerian John
Guest
Posts: n/a
 
      08-20-2003
Hi, folks:

I am looking for a way to get the name of the current page in code. Just
the page name, eg. login.aspx.
I have used Request.CurrentExecutionFilePath and the Split method of the
String class, like this:
Dim thisPath As String = Request.CurrentExecutionFilePath

Dim thisPage As String() = thisPath.Split("/"c)

Dim pageName = thisPage(thisPage.Length - 1)

There must be a simpler way!

TIA,

Val




 
Reply With Quote
 
 
 
 
MS News \(MS ILM\)
Guest
Posts: n/a
 
      08-20-2003
Dim pageName As String =
Request.CurrentExecutionFilePath().Replace(Request .ApplicationPath + "/",
"")

"Valerian John" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi, folks:
>
> I am looking for a way to get the name of the current page in code. Just
> the page name, eg. login.aspx.
> I have used Request.CurrentExecutionFilePath and the Split method of the
> String class, like this:
> Dim thisPath As String = Request.CurrentExecutionFilePath
>
> Dim thisPage As String() = thisPath.Split("/"c)
>
> Dim pageName = thisPage(thisPage.Length - 1)
>
> There must be a simpler way!
>
> TIA,
>
> Val
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
using the current method name within current method Matthew Heidemann Ruby 14 03-22-2011 03:56 AM
Retrieve the name of current running method. Walle Wallen Ruby 2 06-11-2010 04:17 PM
how can i retrieve the name of form when one of the element name in this form is 'name' ashok.dhananjeyan@gmail.com Javascript 6 11-24-2006 02:54 AM
How to update the current web page? (delete current web page + rewrite the page) laryten@yahoo.com Javascript 3 10-12-2006 07:33 PM
Retrieve Page Name in asp.net page Ersin Inan ASP .Net 2 11-08-2003 02:41 AM



Advertisments