views:

131

answers:

1

Our web application has a control that's set up with a markup, code-behind, and designer file, as so:

Markup

<%@ Control Language="VB" AutoEventWireup="false"
    Inherits="NewNameSpace.Controls.generic_selector" Codebehind="generic-selector.ascx.vb" %>

For some reason, while it worked before when it was in the default namespace, when we moved it to a new namespace we now get a parser error:

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'NewNameSpace.Controls.generic_selector'.

Addendum: I did move the markup, the code-behind, and the designer file to the new namespace. Didn't seem to help.

The project still builds correctly. Is there something else we need to do?


Update:

Taking another look at it this week, here's my guess. When creating a control by default, it goes in to Global.NameOfProject.NameOfControl.

Maybe the new control is now in Global.NameOfProject.NewNameSpace.Controls?


Update:

The control does appear to partially go in the namespace Global.NameOfProject.NewNameSpace.Controls. The trouble is, it's not clear how to move the whole class over to a new namespace. I've tried various markup changes and none of them seem to stick - only the default namespace seems to work with no hiccups.

So my question remains: How does one move a Web User Control to a different namespace?

+3  A: 

You need to change the namespace on the code-behind class as well.

Open the generic-selector.ascx.vb file and make sure that the generic-selector type is wrapped in the propert namespace like this:

Namespace NewNameSpace.Controls
    Class generic-selector

    End Class
End Namspace
Andrew Hare
Did that already - good place to start, though.
Chris