Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : 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 February 4th, 2011, 01:30 PM
Registered User
 
Join Date: Feb 2011
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default app_offline.htm

I am working with the book ASP.Net 4 in C# and VB. I am in chapter 14. I went to open my browzer to view a page and received this message,"This application is currently offline. To enable the application, remove the app_offline.htm file from the application root directory.

How do I get to the root directory to get rid of the"app_offline" file? What did I do to get this message? How can I prevent it in the future?
 
Old February 4th, 2011, 01:39 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,

There are two ways:

1. Refresh the Solution Explorer and you'll see the file

2. Open the site's folder on disk (e.g. something like C:\BegASPNET\Site)

Visual Studio creates that file for you when it needs to lock the site, but it doesn't always automatically delete it.

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!
The Following User Says Thank You to Imar For This Useful Post:
cokerr (February 4th, 2011)
 
Old February 9th, 2011, 08:53 PM
Registered User
 
Join Date: Feb 2011
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default Problem on Page 483

I on working on Page 483 of Beginning Asp.Net 4 in C# and VB. I tried following the instructions to fix an error that is mentioned. It is that one immediately gets an error when you type “PlanetWroxEntities…..”

I have tried the solution mentioned on the page of typing “Imports PlanetWroxModel” as I am using VB. It does not work for me. There is an alternate method listed of “Click once on the word PlanetWroxEntities and press Control+Dot. That brings up a dialog box, but the box’s first entry is, “PlanetWroxEntities to PlanetWroxModel.Reviews” is not a choice that is listed in the book and it does not work for me either.

Please help me solve this.
 
Old February 10th, 2011, 03:59 AM
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,

First of all, when you have a new topic, can you please start a new thread? Your new problem is not related to app_offline, making this thread more confusing.

Are you sure you followed the steps to set up the model correctly? What name did you give the model in the first steps of that exercise? You can check the names by opening the model designer in Visual Studio. Then click on a while spot of the design surface, open up the Properties Grid (F4) and check the Entity Container and Namespace properties. What do you see there?

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 February 10th, 2011, 11:14 AM
Registered User
 
Join Date: Feb 2011
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default Problem on Page 483 of Beginning ASP.Net 4 in C# and VB

In your reply, you asked me what I see in the Entity Container and the Namespace properties. The Entity Container Name is PlanetWroxEntities2. When I try to change it to delete the "2", I get an error message that the name is not valid. The Namespace property is PlanetWroxModel.

Thank you for your help.
 
Old February 10th, 2011, 11:24 AM
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,

It sounds like you have other classes or a model already in your project with the same name.

You can either try to continue with PlanetWroxEntities2 instead of PlanetWroxEntities, or delete anything from your App_Code folder related to the model and its "code behind" designer files, and then recreate the model.

Hope this helps,

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 February 10th, 2011, 12:00 PM
Registered User
 
Join Date: Feb 2011
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default Problem on Page 483 of Beginning ASP.Net 4 in C# and VB

Thank you. I re-created the model and also added "Imports PlanetWroxModel" and did your alternate suggestion. This time it worked and added PlanetWroxEntities3 as the New instance.
 
Old February 10th, 2011, 12:10 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
This time it worked and added PlanetWroxEntities3 as the New instance.
Ah, I think the sequential nnumber is caused by the connection strings in the web.config. The EF model keeps track of the connection string in web.config and uses the name of the model as the key foer the conenction string. If the key already exists, you get a numbered new one. So, if you want to continue "by the book", you could recreate the model once more, after you've deleted the connection strings from the config file.

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 February 10th, 2011, 02:02 PM
Registered User
 
Join Date: Feb 2011
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default Problem on Page 483 of Beginning ASP.Net 4 in C# and VB

I tried what you suggested about going “by the book” and then it did not work. I kept getting an error message about “PlanetWroxEntities1 not existing”, even when I changed the code behind in All.aspx to PlanetWroxEntities without the “1”.

So then I went to the web site and pulled down all the source code again. I loaded the source code in web.confiq, App_Code, Database, Master Pages, and All.aspx and Code Behind pages and I still get the error about “PlanetWroxEntities1 not existing”, even though I can’t find a reference to “PlanetWroxEntities1” anywhere.

Any thoughts?
 
Old February 10th, 2011, 03:54 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
I still get the error about “PlanetWroxEntities1 not existing”,
That's how it's supposed to be. If you have no prior models and create a new one by following the instructions your model should be called PlanetWroxEntities without the 1. Only when you create more models off the same database does EF start numbering them sequentially.

If this still doesn't help, can you zip up the site and sent it to? You can contact me through my web site (see signature) to find out my e-mail address.

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!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload_image.htm Chapter 7 jeroen BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 2 September 3rd, 2009 11:53 AM
Question on NameSpaceBooks.htm manahual BOOK: Professional Ajax ISBN: 978-0-471-77778-6 0 September 20th, 2006 10:42 AM
How can i rewrite the example bookClient.htm Keyne XML 0 August 23rd, 2006 07:11 AM
App_Offline.htm won't allow me to test. VictorVictor BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 5 March 2nd, 2006 10:46 AM
how to use recordType in htm/asp gilgalbiblewheel Classic ASP Databases 11 August 15th, 2004 12:06 AM





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