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
This is the error message from the yellow screen of death.
Code:
Server Error in '/Chapter 13' Application.
--------------------------------------------------------------------------------
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0103: The name 'Roles' does not exist in the current context
Source Error:
Line 45: case ListViewItemType.DataItem:
Line 46: Button deleteButton = (Button)e.Item.FindControl("DeleteButton");
Line 47: deleteButton.Visible = Roles.IsUserInRole("Manager");
Line 48: break;
Line 49: }
Source File: c:\Wrox Ripup\Chapter 13\ManagePhotoAlbum.aspx.cs Line: 47
case ListViewItemType.DataItem:
Line 46: Button deleteButton = (Button)e.Item.FindControl("DeleteButton");
Line 47: deleteButton.Visible = Roles.IsUserInRole("Manager");
Line 48: break;
Line 49: }
Have you checked the Roles is publicly invoked in your page class. If it is a static class, then please check whether you are having the reference for your class?