Link to home
Start Free TrialLog in
Avatar of Howard Katz
Howard KatzFlag for United States of America

asked on

User-defined namespace not recognized

Hello, experts!

I created some user controls for my ASP.NET 2.0 web site.  They live in UserControls folder, and each one has a line like this at the top of the .ASCX file

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="dropdownlist.ascx.vb" Inherits="QuoteUserControls.UserControls_dropdownlist" %>

and the codebehind looks like this:

Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls

Namespace QuoteUserControls
    Partial Class UserControls_dropdownlist
        Inherits System.Web.UI.UserControl
[... Some public and private properties and methods]
    End Class
End Namespace

For some reason the namespace QuoteUserControls is sometimes not recognized in the master page.  I need to close Visual Studio and reopen it to get it to compile after I make a code change.  Right now I have tried this approach multiple times, but it's not working.  This namespace is recognized in other ASPX pages, just not in master.vb.  Anyone have any ideas what's wrong?  Thanks for your help!

ASKER CERTIFIED SOLUTION
Avatar of hismightiness
hismightiness

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Howard Katz

ASKER

Thanks for your reply!  The problem wasn't with the namespace.  I finally had to @Register each of the user controls in my master page.  I thought registering them in the web.config was supposed to eliminate the necessity for the @Register statement in each aspx page, but it doesn't seem to work in my project.  I got rid of the namespace since it wasn't necessary.