Solved

Need Page Name without needing asp.net authentication

Posted on 2010-11-08
4
269 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
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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

777 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