Show current web address in Label or textbox

K

Ken

Is there any way to show current webpage in Label or textbox?

for example, if the page address I browse currently is
http://localhost/try/default.aspx then I want to show the information about
current address in Label or Textbox on current page (in this case, the
default.aspx).
 
T

Teemu Keiski

Hi,.

you get information about request (also the requested Url) via Request
object

For example:

Label1.Text = System.IO.Path.GetFileName(Request.FilePath)
 
K

Ken

well,
I need Whole address including "Http"
the reason of this is to check the if the page is "Http" or "Https"

Thanks
 
J

Juan T. Llibre

Use Request.Url.ToString



Juan
====
Ken said:
well,
I need Whole address including "Http"
the reason of this is to check the if the page is "Http" or "Https"

Thanks
 

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,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top