Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   How to retrieve current page name (http://www.velocityreviews.com/forums/t62931-how-to-retrieve-current-page-name.html)

Valerian John 08-20-2003 07:25 PM

How to retrieve current page name
 
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





MS News \(MS ILM\) 08-20-2003 08:35 PM

Re: How to retrieve current page name
 
Dim pageName As String =
Request.CurrentExecutionFilePath().Replace(Request .ApplicationPath + "/",
"")

"Valerian John" <vjohn@shentel.net> wrote in message
news:OSvQGD1ZDHA.2308@TK2MSFTNGP12.phx.gbl...
> 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
>
>
>
>





All times are GMT. The time now is 05:25 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.