Solved

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

Posted on 2009-07-13
4
776 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Suggested Courses

738 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