Solved

System.Web.HttpContext.Current.Request.Url.ToString() wok on local station but not working on server

Posted on 2009-07-13
4
773 Views
Last Modified: 2012-05-07
hi i m using following code. it working fine on local station but not showing result output when i upload this code on to server.

Is it need any iis setting. m using asp.net 2.0
any suggestion will be appriciated.

Thanks
sidharth
protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                string strCurrenturl1 = System.Web.HttpContext.Current.Request.Url.ToString();
 
                string url = HttpContext.Current.Request.Url.OriginalString;
                Label1.Text = strCurrenturl1;
               // Label2.Text = url;
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }

Open in new window

0
Comment
Question by:psaini172000
  • 2
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
paololabe earned 500 total points
ID: 24838315
In iis you have to set the .net version in the asp.net tab.


0
 
LVL 8

Expert Comment

by:paololabe
ID: 24838320
Are you sure the event is executed ? for example set Label1.Text="Hello" ti check it.
0
 

Author Comment

by:psaini172000
ID: 24838474
i hav set the version already
0
 

Author Closing Comment

by:psaini172000
ID: 31602752
IT DID'T SOLVE MY PROBLEM
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question