Solved

Need Page Name without needing asp.net authentication

Posted on 2010-11-08
4
274 Views
Last Modified: 2012-05-10
Hello, I need the page name of the current asp.net page but the problem that I am having is I am getting security issues with the following code:

 Public Function GetCurrentPageName() As String
        Dim sPath As String = System.Web.HttpContext.Current.Request.Url.AbsolutePath
        Dim fInfo As System.IO.FileInfo = New System.IO.FileInfo(sPath)

        Return fInfo.Name
    End Function

How can I get the current page name without the security issues on an asp.net page when it is up on the server?  Please let me know.  Thanks!
0
Comment
Question by:VBBRett
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 3

Expert Comment

by:mortimer452
ID: 34086520
HttpContext.Current.Server.MapPath(HttpContext.Current.Request.Servervariables("SCRIPT_NAME"))

DIdn't I already answer this in another post?
0
 
LVL 3

Accepted Solution

by:
mortimer452 earned 167 total points
ID: 34086548
I take that back, you may need to use Server.MapPath(System.Web.HttpContext.Current.Request.Url.AbsolutePath) instead
0
 
LVL 4

Assisted Solution

by:vinodch
vinodch earned 167 total points
ID: 34086638
Page.Request.RawUrl.ToString();

Page.Request.Url.ToString();
0
 
LVL 9

Assisted Solution

by:puru1981
puru1981 earned 166 total points
ID: 34086661
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question