Hi Friends,
I am developing an admanagment system to. Here i have created an asmx file which returns path of image when an request arrives for an ad.
Here i need to get URL and IP address of request which i need to store so as to get number of views.
How can i get request URL. I have tried using "string url = HttpContext.Current.Request.Url.ToString();" but it returns its own url.
For example if esp.xxpsol.com is request url but it will store its own url say adv.xxp.com.
How to do this
To get url and ipaddress of request
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Suthish NairRank #92 · 22.8K reputationPosted Sep 28, 2010, 12:20 AM EDT
HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"].ToString(); ==> IP
HttpContext.Current.Request.Url.AbsoluteUri.ToString(); ==> url
rajath r30 reputationPosted Sep 28, 2010, 4:41 AM EDT
I have tried your code but it will return its own url. Here i need the url of request.
I need to geturl which uses the asmx file.
Suthish NairRank #92 · 22.8K reputationPosted Sep 29, 2010, 9:25 AM EDT
HttpContext.Current.Request.UrlReferrer
Request.UrlReferrer.Segments