Wrox Programmer Forums
|
BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9
This is the forum to discuss the Wrox book Professional ASP.NET 3.5: In C# and VB by Bill Evjen, Scott Hanselman, Devin Rader; ISBN: 9780470187579
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 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 24th, 2009, 05:50 PM
Authorized User
 
Join Date: Dec 2008
Posts: 26
Thanks: 3
Thanked 0 Times in 0 Posts
Exclamation P552: The name 'Roles' does not exist in the current context

Hello,

I am unable to complete the Try It Out on pp 552-3. I get the following build error:
CS0103: The name 'Roles' does not exist in the current context
I double-checked that I typed the code example (C# version) exactly as shown on page 552 and that I have Role Manager enabled in web.config.

Any assistance would be most welcome and appreciated.....
__________________
~ Eddie McHam
 
Old April 26th, 2009, 09:35 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,

Is this for the book Professional ASP.NET 3.5 or for Beginning ASP.NET 3.5? You posted it in the Pro category, but the Beginning book as an exercise with Roles on page 552 / 553 as well...

If you click on the word Roles in the code behind, do you get a small red line under the letter s? If so, then press Shift+Alt+F10 to bring up the Smart Tag for the problem. It gives you two options to fix the problem. Choose the first one that adds a using statement for the System.Web.Security namespace.

In the RTM version of VWD (which was used for this book), this namespace was included by default. However, it seems that SP 1 has changed the default templates a bit so some namespace are no longer included by default.

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!
The Following User Says Thank You to Imar For This Useful Post:
eddiemcham (May 1st, 2009)
 
Old May 1st, 2009, 04:27 PM
Authorized User
 
Join Date: Dec 2008
Posts: 26
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Sorry for the delayed reply. Got pulled away on several "must have yesterday" projects and am just now getting back to this.

The Ctrl-Shift-F10 didn't pull up anything, and the line under 'Roles' was blue.

But I did manually insert the System.Web.Security line, and now the page works. So I can move on.

Thanks for adding that line to your post! I would've never known about it, much less where to find out about it.

BTW, I'm in the Beginning ASP.NET book. This is my first experience with it. Overwhelming, but I'm slowly getting there (I think).
__________________
~ Eddie McHam
 
Old May 1st, 2009, 05:03 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Ctrl-Shift-F10 != Shift+Alt+F10 ;-)

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
The name 'partOneStep' does not exist in the current context pallone ASP.NET 3.5 Basics 11 March 4th, 2009 05:30 AM
The name 'txtOperande1' does not exist in the current context stevemcd999 BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3 3 February 25th, 2009 11:58 PM
Unable to set context in web.xml or context.xml. dchicks Apache Tomcat 1 March 7th, 2008 07:59 AM
Position of a node outside current context QuickSilver002 XSLT 2 April 19th, 2007 02:07 PM
Force current rec on screen if errors exist wscheiman Access VBA 4 November 4th, 2003 02:39 PM





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