473,320 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How can I read the url in browser with asp.net 2.0

I want to get the url in the browser of the user in asp.net 2.0 and
then to do some parsing with it. Which class/method can I use to get
it?

Thank you.

Feb 15 '06 #1
6 5679
Request.Url.ToString()
Request.Url.LocalPath()
Request.Url.PathAndQuery()

http://msdn.microsoft.com/library/de...ssurltopic.asp
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Steve" wrote:
I want to get the url in the browser of the user in asp.net 2.0 and
then to do some parsing with it. Which class/method can I use to get
it?

Thank you.

Feb 15 '06 #2
if in a page, Request.Url, if you are not in a place where you have the
context, use HttpContext.Current.Request.Url.

You can find all the members of the HttpRequest class here -
http://msdn.microsoft.com/library/de...classtopic.asp

Other properties allow you to get things like port, protocol, etc.

HTH,
Darren Kopp
http://blog.secudocs.com/

Feb 15 '06 #3
Request.RawUrl gives you the exact url in the address field of the browser.
This is important when you use url rewriting.

----------------------------
www.madskristensen.dk

"Steve" wrote:
I want to get the url in the browser of the user in asp.net 2.0 and
then to do some parsing with it. Which class/method can I use to get
it?

Thank you.

Feb 15 '06 #4
Thank you Darren.

Feb 16 '06 #5
No problem, glad I could help.

Happy .NETing,
Darren Kopp
http://blog.secudocs.com/

Feb 16 '06 #6
No problem, glad I could help.

Happy .NETing,
Darren Kopp
http://blog.secudocs.com/

Feb 16 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Nik Coughin | last post by:
Is there a simple way of opening a text file from a server, and reading from it line by line? IE http://someserver/file.txt contains a couple of hundred lines. Each line is the name of a...
5
by: Nicolae Fieraru | last post by:
Hi All, I use VC .Net 2003 and I want to create a small program which is able to read the source code of a web site. I have a textbox with the URL, a button and a multiline textbox for the...
1
by: vba man | last post by:
I've used the following code to open a browser window and read the data to a file. I know there is another way using a query, but that doesn't work for this application. What I'd like to be able...
3
by: Csaba Gabor | last post by:
Not sure of best place for this question... Are there any built in images within the browser that I can assume (particularly IE and FF)? More specifically, I am writing a one file webApp.php...
2
by: microdevsolutions | last post by:
Hello I've seen examples to read a file from somewhere into a HttpWebRequest object then write it to a HttpWebResponse object then stream it into a Stream object, very similar to the following...
6
by: Karthik | last post by:
I am trying to read Http request body values NOT form values The content type is text/xml and its POST I am posting data from Infopath to an asp.net page. In ASP it works by just writing...
10
by: MLH | last post by:
I wish to give someone an A97 database they can install on their PC as a runtime application. I want them to click a button on a form (frmDocumentMyPC). I want to document as much useful...
6
by: dinoo | last post by:
Hi, I would appreciate if some one could help me out. I have to read a client side ini file in Aspx page and use that data in server side processing. Can any one help me out here? Please refer...
1
by: Arpan | last post by:
The contents of a text file are as follows: The Quick Brown Fox Jumped Over The Lazy Dog. Note that there isn't any space at the end of each of the 3 lines. Now when I do this:
4
by: Misfit | last post by:
I have wondered, and I've tried this on a few random sites. I type the name of a site. www.somesite.com and follow it with /robots.txt. This can tell the robots not to bother indexing the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.