Solved

get the page name and querystrings only

Posted on 2011-09-14
4
309 Views
Last Modified: 2012-08-13
hi, supose i have this page:

http://www.mywebsite.com/test.aspx?id=1

i want to get this part only: test.aspx?id=1
i know how to get the last part: Request.Url.Query but how to get just the page name test.aspx?
some help?
0
Comment
Question by:rafaelrgl
  • 2
4 Comments
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
With Javascript use : var thePath = location.pathname.substr(1);
0
 
LVL 1

Author Comment

by:rafaelrgl
Comment Utility
and with asp.net using vb
0
 
LVL 16

Accepted Solution

by:
disrupt earned 500 total points
Comment Utility

Public Function GetCurrentPageName() As String
	Dim sPath As String = System.Web.HttpContext.Current.Request.Url.AbsolutePath
	Dim oInfo As New System.IO.FileInfo(sPath)
	Dim sRet As String = oInfo.Name
	Return sRet
End Function

Open in new window

0
 
LVL 1

Author Closing Comment

by:rafaelrgl
Comment Utility
thanks a lots :)
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 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

11 Experts available now in Live!

Get 1:1 Help Now