localhost vs. machinename

G

GaryDean

Some of the pages in the anonymous folder of our asp.net app get executed
from external hyperlinks in other websites, emails, etc. Often they have a
querystring. We are noticing that if the hyperlink was
http://machinename/mywebsite the page isn't getting its Page_load code
executed. But if the link is http://localhost/mywebsite everything works
fine.

This is all in a testing environment now but why is this?
 
G

George

You are absolutely not clear when you saying that Page_load code is not
executed. Is anything else is executed. What error does browser shows?

I would think it's Firewall problem. And it does not let your request
through but hard to guess without knowing what error you get in a browser.
George.
 
R

rstrahl

Are you sure? It should make no difference whether the page was loaded
through an IP address, domain name or a local domain machine name...

As long as requests are fired through HTTP (ie. not as a file share) code
will fire...

+++ Rick ---
 
G

GaryDean

When I say "page_load code is not executed" I mean the the code in the
Page_load event does not get executed. There is no browser error.
 
G

Gregory A. Beamer

Is the app being hit at all. If you put a page like index.html in the site
and call http://machinename/mywebsite/index.html, does it serve the page? If
not, try pinging machinename and see if it returns an IP address. If not,
you do not have a DNS server on your local network. You can potentially
circumvent this with WINS, but a DNS server is the better option.

You can get around this with a kludge. Add the entry to the HOSTS file
located at %WIN_DIR%\System32\drivers\etc. %WIN_DIR% is C:\Windows or
C:\Winnt on most machines.

If you are getting an ip, try hitting the IP address /mywebsite and see if
it serves. If not, you have some form of ASP.NET permissions error on the
IP, or similar. I have never seen this issue, however, so I would not know
how to fix it.

--
Gregory A. Beamer
MVP: MCP: +I, SE, SD, DBA

Blog:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think Outside the Box! |
********************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top