Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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 May 19th, 2008, 10:38 AM
Registered User
 
Join Date: Apr 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default why localhost doesn't work?

My web site is working when I click Start Debugging(F5). The data can be retrived from the database correctly. The url is http://localhost:1708/mywebsite/home.aspx. But when I type http://localhost/mywebsite/home.aspx in the url directly, I got the following error message: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) .

I use SQL Server 2000 (not 2005) and the database is on another server myWebsiteDB. The connectString set up is: <add name="LocalSqlServer" connectionString="Data Source=dbServer;Initial Catalog=myWebsiteDB;Persist Security Info=True;User ID=sa;Password=mypw#" providerName="System.Data.SqlClient"/>.

Could any one tell me why the localhost doesn't work? Thanks in advance!

 
Old May 19th, 2008, 03:42 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Are you sure that "http://localhost/mywebsite" is really pointing to the same place as "http://localhost:1708/mywebsite/"? I ask only because it is very strange that you would have this problem as you describe it.

-Peter
compiledthoughts.com
 
Old May 19th, 2008, 04:57 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
Default

I have had this before at work, I think it is because of the ACL on the folder.

Ensure you have set the ACL on the folder to allow the ASP Machine account is given full access to the folder. This can often occur when a directory is moved from one location to the wwwroot folder..

Hope this helps, if not please shout and I will check settings once I am back in the office, I have definately experienced the same problem that you are having though.

Rob
http://robzyc.spaces.live.com
 
Old May 20th, 2008, 09:48 AM
Registered User
 
Join Date: Apr 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by planoie
 Are you sure that "http://localhost/mywebsite" is really pointing to the same place as "http://localhost:1708/mywebsite/"? I ask only because it is very strange that you would have this problem as you describe it.

-Peter
compiledthoughts.com
How can I tell they are pointing to the same place?

 
Old May 20th, 2008, 09:55 AM
Registered User
 
Join Date: Apr 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by robzyc
 I have had this before at work, I think it is because of the ACL on the folder.

Ensure you have set the ACL on the folder to allow the ASP Machine account is given full access to the folder. This can often occur when a directory is moved from one location to the wwwroot folder..

Hope this helps, if not please shout and I will check settings once I am back in the office, I have definately experienced the same problem that you are having though.

Rob
http://robzyc.spaces.live.com
Thanks Rob. The localhost is not working only when the page needs to retrive data. [u]http://localhost/mywebsite/home.aspx</u> is a page has SqlDataSource and GridView. But the login page [u]http://localhost/mywebsite/login.aspx</u> is working. So I guess it's nothing to do with ACL on the folder.

 
Old May 20th, 2008, 03:56 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You'll have to check the IIS virtual directory configuration for where it points to. It should be pointing to the same dir/project you are opening in visual studio.

-Peter
compiledthoughts.com
 
Old May 23rd, 2008, 04:24 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi, sorry for the delay in replying, been swamped of late!

Is this problem still outstanding? Resolved?

Rob
http://robzyc.spaces.live.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
localhost ongmymap ASP.NET 3.5 Basics 5 November 8th, 2008 02:09 PM
CAN'T CONNECT TO LOCALHOST.... lamada BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 3 December 13th, 2005 06:01 PM
do not want to use localhost p2ptolu Classic ASP Databases 1 September 15th, 2005 06:03 PM
problem deploying to work/standalone/localhost leonbrits Apache Tomcat 0 August 26th, 2005 07:22 AM
Localhost Yee Dreamweaver (all versions) 6 October 21st, 2004 09:21 AM





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