How to get the current url in the code [modified]
-
Hi, i have a requirement like as below. I need to get the current url of the browser in the code.Based on that url the logic will depends. The problem is we are doing URL rewriting in web.config. Original URL - http://mysite.com/test/mypage.aspx URLRewrite - http://mysite.com/site/champ In my code if i use Request.URL i am getting URLRewrite one. But how can i get the original url in mycode ? Please suggest me
G. Satish
modified on Friday, October 29, 2010 3:49 AM
-
Hi, i have a requirement like as below. I need to get the current url of the browser in the code.Based on that url the logic will depends. The problem is we are doing URL rewriting in web.config. Original URL - http://mysite.com/test/mypage.aspx URLRewrite - http://mysite.com/site/champ In my code if i use Request.URL i am getting URLRewrite one. But how can i get the original url in mycode ? Please suggest me
G. Satish
modified on Friday, October 29, 2010 3:49 AM
Did you try
Request.QueryString
?
-
Hi, i have a requirement like as below. I need to get the current url of the browser in the code.Based on that url the logic will depends. The problem is we are doing URL rewriting in web.config. Original URL - http://mysite.com/test/mypage.aspx URLRewrite - http://mysite.com/site/champ In my code if i use Request.URL i am getting URLRewrite one. But how can i get the original url in mycode ? Please suggest me
G. Satish
modified on Friday, October 29, 2010 3:49 AM
Try this
string sURL = Request.Url.AbsolutePath;
thatraja |Chennai|India|
Brainbench certifications
Down-votes are like kid's kisses don't reject it :-)
Do what you want quickly because the Doomsday on 2012 :-)