Solved

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

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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Suggested Solutions

First of all, clustering IIS is something you should rarely consider doing. In almost all cases, Microsoft Network Load Balancing (NLB) (http://technet.microsoft.com/en-us/library/cc758834(WS.10).aspx) is a much better solution when you need to p…
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

914 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

16 Experts available now in Live!

Get 1:1 Help Now