Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 13th, 2005, 11:29 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default Actual Server nam in Address & not LOCALHOST?

I'm sending a link from an ASP page to users via email. To point to the correct server, I'm using Request.ServerVariables("SERVER_NAME") to obtain the server name for the link. When running on my development server from within VS, LOCALHOST appeatrs as the server name rather tyhan the machine's name. This causes the link to fail when others reference it. Is there some way to get VS to display the actual server name rather than LOCALHOST in the address line so that when I create this link, it gets the real name?
 
Old April 13th, 2005, 07:41 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Have you tried accessing the page with your machine name? After all, that's the only way the users will be able to access it. Then, SERVER_NAME will come back as the server name they are using to access the site whether it's a full URL, LAN machine name or IP address.

-Peter
The Following User Says Thank You to planoie For This Useful Post:
Ron Howerton (February 22nd, 2013)
 
Old April 14th, 2005, 07:00 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default

Yes, but the default when running from VS is LOCALHOST. That means I have to go up to the address bar and manually override LOCALHOST with my machine name. IOW, when runnign from within VS I wanted the machine name to appear there by default, not LOCALHOST.

It's a moot point now. I've found another way to get what I wanted without referencing the address bar. Thanks!
 
Old April 14th, 2005, 08:23 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I don't know if there's a way to change that. Probably not. I never browse from within VS so I haven't had to play with it.
The Following User Says Thank You to planoie For This Useful Post:
Ron Howerton (February 22nd, 2013)
 
Old April 14th, 2005, 09:01 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

This is determined when you create a new project.

If you create a new project at http://localhost/App1 it will browse to http://localhost/App1.
If you create it as http://MachineName/App1 it will browse to http://MachineName/App1

If you're brave, you can shut down VS.NET and then manually change the references in the .sln file for an existing project....

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
The Following User Says Thank You to Imar For This Useful Post:
Ron Howerton (February 22nd, 2013)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking via Actual Address SerranoG Access 2 July 16th, 2006 02:33 AM
Can't connect to mySql server using localhost RobinR MySQL 3 January 30th, 2006 10:07 PM
Localhost was pointing to other server leion General .NET 1 January 6th, 2005 03:21 AM
Retreiving IP address & gateway address sjangit VBScript 0 February 3rd, 2004 02:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.