Solved

Determine if Running App From Local or ISP Host

Posted on 2013-06-16
2
424 Views
Last Modified: 2013-06-16
I need code to determine if my app is running on the ISP Host

When on local host the address text is "http://localhost:51821/MyPage.aspx"

On the ISP host the address is "http://www.MyDomainName.com/"

I need something like the following:

if(localhost)
  {
        Do Something  
   }

else

{

        Do Something else
}

Thanks,
0
Comment
Question by:Dovberman
[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 Comments
 
LVL 80

Accepted Solution

by:
David Johnson, CD, MVP earned 300 total points
ID: 39251919
use the Response.Write(Request.ServerVariables["LOCAL_ADDR"]);

i.e.
 <p><b>You are browsing this site with:</b>
<%Response.Write(Request.ServerVariables("LOCAL_ADDR"))%>
</p>

Use the results from the request to do your checking.
0
 

Author Closing Comment

by:Dovberman
ID: 39252272
That worked.

Thanks
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

733 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