[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 783
  • Last Modified:

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

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
psaini172000
Asked:
psaini172000
  • 2
  • 2
1 Solution
 
paololabeCommented:
In iis you have to set the .net version in the asp.net tab.


0
 
paololabeCommented:
Are you sure the event is executed ? for example set Label1.Text="Hello" ti check it.
0
 
psaini172000Author Commented:
i hav set the version already
0
 
psaini172000Author Commented:
IT DID'T SOLVE MY PROBLEM
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now