Getting Current URL In ASP.NET 2.0

C

Chip Pearson

This is probably an extremely simple question. How do I get a page's own
URL? In the footer section of my Master page, I want a Label control that
will be updated with the page's own URL. Something like:

Protected Sub Page_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Me.Load
Me.Label1.Text = "This Page: " & "get current URL?"
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting LLC
www.cpearson.com
(email on the web site)
 
M

Michael Nemtsev

Hello Chip,

Me.Label1.Text = "This Page: " & Request.Url.ToString()


---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

CP> This is probably an extremely simple question. How do I get a page's
CP> own URL? In the footer section of my Master page, I want a Label
CP> control that will be updated with the page's own URL. Something
CP> like:
CP>
CP> Protected Sub Page_Load(ByVal sender As Object, _
CP> ByVal e As System.EventArgs) Handles Me.Load
CP> Me.Label1.Text = "This Page: " & "get current URL?"
CP> End Sub
 
C

Chip Pearson

Me.Label1.Text = "This Page: " & Request.Url.ToString()

Perfect. That is exactly what I was looking for. Thank you very much.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting LLC
www.cpearson.com
(email on the web site)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top