Solved

Need Page Name without needing asp.net authentication

Posted on 2010-11-08
4
266 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
  • 2
4 Comments
 
LVL 3

Expert Comment

by:mortimer452
Comment Utility
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
Comment Utility
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
Comment Utility
Page.Request.RawUrl.ToString();

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

Assisted Solution

by:puru1981
puru1981 earned 166 total points
Comment Utility
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now