Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 280
  • Last Modified:

Need Page Name without needing asp.net authentication

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
VBBRett
Asked:
VBBRett
  • 2
3 Solutions
 
mortimer452Commented:
HttpContext.Current.Server.MapPath(HttpContext.Current.Request.Servervariables("SCRIPT_NAME"))

DIdn't I already answer this in another post?
0
 
mortimer452Commented:
I take that back, you may need to use Server.MapPath(System.Web.HttpContext.Current.Request.Url.AbsolutePath) instead
0
 
vinodchCommented:
Page.Request.RawUrl.ToString();

Page.Request.Url.ToString();
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now