Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5.1: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-84677-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5.1 : in C# and VB 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 November 23rd, 2015, 01:49 PM
Authorized User
 
Join Date: Oct 2015
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
Default Chapter 19 - viewing website in browser

Hi,

I'm trying to deploy the website and when I request http://localhost in the browser I just get the directory view (I enabled directory browsing). If I click on a file, it says File not found. It says I should do something to do with MIME but I am not sure what exactly.
Otherwise, if Directory Browsing is disabled, it's HTTP Error 403.14 - Forbidden (advising to enable directory browsing).

Thanks
 
Old November 27th, 2015, 03:57 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Did you install ASP.NET 4.5 on the server and set Default.aspx as the default document?

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old November 30th, 2015, 05:29 AM
Authorized User
 
Join Date: Oct 2015
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I installed .NET 4.5, and set the default document to Default.aspx

Now it is saying

Server Error in '/' Application.

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Line 46: public virtual string FavoriteTheme {
Line 47: get {
Line 48: return ((string)(this.GetPropertyValue("FavoriteTheme"))) ;
Line 49: }
Line 50: set {

Source File: c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Te mporary ASP.NET Files\root\47406c78\4c7c1534\App_Code.z0m5nzk-.9.cs Line: 48

Thanks

Last edited by OxieK; November 30th, 2015 at 11:08 AM..
 
Old December 2nd, 2015, 07:14 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

That sounds like an issue with the connection strings. Did you update the web.config as explained in the boo so the various connection strings point to the proper database?

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old December 3rd, 2015, 08:52 AM
Authorized User
 
Join Date: Oct 2015
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I've got this in web.config
<add name="PlanetWroxConnectionString1" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirec tory|\PlanetWrox.mdf;Integrated Security=True" providerName="System.Data.SqlClient" />

add name="PlanetWroxEntities" connectionString="metadata=res://*/App_Code.PlanetWrox.csdl|res://*/App_Code.PlanetWrox.ssdl|res://*/App_Code.PlanetWrox.msl;provider=System.Data.SqlCl ient;provider connection string=&quot;data source=(LocalDB)\v11.0;attachdbfilename=|DataDirec tory|\PlanetWrox.mdf;integrated security=True;MultipleActiveResultSets=True;App=En tityFramework&quot;" providerName="System.Data.EntityClient" />

web.To Local Disk config

<connectionStrings>
<add name="PlanetWroxConnectionString1" connectionString="Data Source=.\SqlExpress;AttachDbFilename=|DataDirector y|\PlanetWrox.mdf;Integrated Security=True" providerName="System.Data.SqlClient" xdt:Transform="SetAttributes" xdt:Locator="Match(name)" />
<add name="PlanetWroxEntities" connectionString="metadata=res://*/App_Code.PlanetWrox.csdl|res://*/App_Code.PlanetWrox.ssdl|res://*/App_Code.PlanetWrox.msl;provider=System.Data.SqlCl ient;provider connection string=&quot;data source=.\SqlExpress;attachdbfilename=|DataDirector y|\PlanetWrox.mdf;integrated security=True;MultipleActiveResultSets=True;App=En tityFramework&quot;" providerName="System.Data.EntityClient" xdt:Transform="SetAttributes" xdt:Locator="Match(name)" />
</connectionStrings>

Thanks.

Last edited by OxieK; December 4th, 2015 at 05:09 AM..
 
Old December 4th, 2015, 06:44 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Do you have an instance of SQL Server called SqlExpress running on your deployment machine?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Theme Error When Viewing in Browser chrisreyno BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 September 11th, 2009 10:44 AM
Viewing code rather than content in browser aspnewbie Classic ASP Basics 2 March 27th, 2006 10:47 AM
Viewing my website. boksi Classic ASP Basics 0 June 16th, 2005 03:44 PM





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