i have a UserControl
in ASP.net:
GrobSelector.ascx.cs
:
...
public partial class GrobSelector : System.Web.UI.UserControl
{
...
i want to wrap this class in a namespace:
GrobSelector.ascx.cs
:
...
namespace GrobSelectorNamespace
{
public partial class GrobSelector : System.Web.UI.UserControl
{
...
...
}
Except now code fails to compile:
public partial class GrobSelector : System.Web.UI.UserControl
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).
What's the correct way to put an ASP.net UserControl
in a namespace?
Bonus Chatter
The code in-front file contains:
GrobSelector.ascx
:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="GrobSelector.ascx.cs"
Inherits="GrobSelector" %>
Bonus Reading
- Putting a Web User Control (ascx) in a namespace?
- namespace in asp.net usercontrol
- Getting namespace name not found for ASP.net user control