Wrox Programmer Forums
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 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 September 19th, 2006, 05:44 PM
Authorized User
Join Date: Sep 2006
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default Make sure the class defined in this file matches .

Hie Guys

I am getting the following error while going thru the Book ASP.NET 2.0 Website Programming Problem Design Solution.
My code is exacly the same as that in the code download but i am getting this error.Please help.

c:\Inetpub\wwwroot\BeerHouse\Controls\ThemeSelecto r.ascx.cs(14): error ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl)

The Code behind for the Themeselector.ascx.cs is as follows

namespace TB.TheBeerHouse
    public partial class ThemeSelector : System.Web.UI.UserControl
        protected void Page_Load(object sender, EventArgs e)
            //create ddl controls' static client side ID which will be maintained between postbacks
            if (Globals.ThemeSelectorID.Length == 0)
                Globals.ThemeSelectorID = ddlThemes.UniqueID;

            //get the themes from Helpers class in App_Code folder and bind to ddl
            ddlThemes.DataSource = Helpers.GetThemes();

            ddlThemes.SelectedValue = this.Page.Theme;


The Control directive for the ThemeSelector user control is like
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ThemeSelector.ascx.cs" Inherits="ThemeSelector" %>

Could someone tell me how to fix this error.


Old September 20th, 2006, 07:19 PM
Registered User
Join Date: Aug 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts

You typed in the code by hand? What you need to do is add "MB.TheBeerHouse.UI.Controls." or "yournamespace.UI.Controls." in the ascx source to:


This is a killer. Every page has it - I always forgot it when I was trying to convert to my own namespace.

Bob Hagan

Similar Threads
Thread Thread Starter Forum Replies Last Post
Class not defined? benatkin Classic ASP Basics 0 May 17th, 2007 12:49 PM
how to change a CONSTANT defined in a class file? sugar PHP How-To 1 June 14th, 2006 11:49 AM
want to make skin class??? simsimlhr C# 0 March 31st, 2004 06:33 AM
How to make a class public johnjonsson VS.NET 2002/2003 0 October 6th, 2003 02:17 PM
CS1595 : 'Class' is defined in multiple places dikkjo VS.NET 2002/2003 2 June 14th, 2003 04:41 AM

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