 |
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
 | This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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
|
|
|
|
|

April 3rd, 2009, 05:21 PM
|
|
Registered User
|
|
Join Date: Apr 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Chaper 8 enum Direction
Code:
switch (DisplayDirection)
{
case Direction.Horizontal:
pnlHorizontal.Visible = true;
break;
case Direction.Vertical:
pnlVertical.Visible = true;
break;
}
}
public Direction DisplayDirection { get; set; }
I can't get this to work. It says the name Direction does not exist in the current context. I have no idea what to do.
|
|

April 4th, 2009, 05:42 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
Did you put the Direction enum on the App_Code folder? Can you post the code for the enum?
Imar
|
|

April 5th, 2009, 12:17 PM
|
|
Registered User
|
|
Join Date: Apr 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Code:
public enum Direction
{
Horizontal,
Vertical
}
The code is in the App_code folder. I've done everything exactly as written in the book. The only difference is when I started I didn't realize but I selected Web Application instead of Website. I don't know if that would make a difference.
|
|

April 5th, 2009, 12:40 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Yes, that makes a *huge* difference. App_Code is not supported in Web Application Projects, only in Web Site Projects.
Search thos forum for posts by member4953 ( http://p2p.wrox.com/members/member4953.html) to see the kind of things he ran into when using a WAP instead of a Web Site. It's doable, but requires some work.....
Imar
|
|

April 5th, 2009, 02:29 PM
|
|
Registered User
|
|
Join Date: Apr 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks for your help. I am really learning a lot from this book.
|
|

April 5th, 2009, 05:44 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
You're welcome.... Hope you're having fun with it while learning... ;-)
If I were you, I'd switch to a Web Site Project. You can download the source from the Wrox site and get the version from the previous chapter. That way, you'll find it easier to follow along with the book. The lack of support for App_Code is one thing (and can easily be fixed by naming the folder something like Classes or CodeFiles), but in later chapters other things won't work either (like ASP.NET Profile which is not so easy to fix).
Cheers,
Imar
|
|

April 5th, 2009, 05:50 PM
|
|
Authorized User
|
|
Join Date: Mar 2009
Posts: 64
Thanks: 0
Thanked 1 Time in 1 Post
|
|
To VistaFTW,
I was using a Web Application Project. I ran into the same problem. I fixed it by not using an App_Code folder, but calling that folder Classes. I then had to make sure that the C# using statement was in the file wherein the enum was going to be used. It did work, but was kind of a pain.
Ultimately I switched to a web site project, as Imar suggests, and just ended a chapter, took the book code for that chapter and launched into the next with no problem, now using the web site project.
Thomas
|
|

April 5th, 2009, 11:47 PM
|
|
Registered User
|
|
Join Date: Apr 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I just copied the source code from chapter 7 into a web site project so that I can start chapter with the website. Thanks for your tip about how to get it to work in a web app.
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| Chaper 6 Pivot transformation example?? |
japak |
BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 |
2 |
March 10th, 2006 12:05 AM |
| Chaper 14 - over $1000 problems |
ftb_tx |
BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 |
0 |
November 21st, 2004 09:15 PM |
|
 |