Solved

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

Posted on 2009-07-13
4
771 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
Lync server 2013 Backup Service Error ID 4049 – After File Share Migration
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now