?
Solved

Need Page Name without needing asp.net authentication

Posted on 2010-11-08
4
Medium Priority
?
275 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 668 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 668 total points
ID: 34086638
Page.Request.RawUrl.ToString();

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

Assisted Solution

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

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

762 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