13.07.2015 Views

ASP.NET 3.5: A Beginner's Guide - www.mustafaof.com

ASP.NET 3.5: A Beginner's Guide - www.mustafaof.com

ASP.NET 3.5: A Beginner's Guide - www.mustafaof.com

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

20<strong>ASP</strong>.<strong>NET</strong> <strong>3.5</strong>: A Beginner’s <strong>Guide</strong>If you run the same program by referencing the IP address (except for 127.0.0.1),whether it is a LAN address or an Internet IP, you will see a different IP address when yourun the same program on the same <strong>com</strong>puter, as shown in Figure 1-12.As you can see in Figure 1-12, the server address (192.168.0.3) and the addressgenerated by the <strong>ASP</strong>.<strong>NET</strong> application are identical. This is because the client and servershare the same IP address.The real test <strong>com</strong>es when you test your application on a different <strong>com</strong>puter. Then thedifferent <strong>com</strong>puter is the client, and where you have <strong>ASP</strong>.<strong>NET</strong> set up is your server.Figure 1-13 shows the program on a <strong>com</strong>puter with Windows XP, while the IIS7 server isset up on a Vista-based operating system on a different <strong>com</strong>puter.In Figure 1-13 you can clearly see that the client’s IP address is different from the IPaddress of the server. By running the <strong>ASP</strong>.<strong>NET</strong> application on a remote client, you canbetter see that what you’re getting is not just the local IP address of the server.The acid test to ensure that what you’re seeing is not just a regular web page thatsomehow gets the IP address from your server is to run the <strong>ASP</strong>.<strong>NET</strong> application on a clientthat you know positively cannot host <strong>ASP</strong>.<strong>NET</strong>. (You probably know that this cannot beac<strong>com</strong>plished with HTML or XHTML alone.) Fortunately, one of the clients on the LANis a Macintosh, and if we call the .aspx file up on a Mac, we know that the only way to seethat Mac’s IP address is if we’re dealing with a true server-side application. Figure 1-14shows what you will see in a Safari browser on a Macintosh.Reference to own IP address in browserFigure 1-12 Addressing LAN IP address

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!