Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 782
  • 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

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