I have a custom control in ASP.NET (VB.NET in code behind), defined with an ASCX:
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="MyControl.ascx.vb" Inherits="Mynamespace.Controls.MyControl" %>
<!-- some html and other custom controls-->
And in code behind:
Namespace Controls
Public Class MyControl
Inherits System.Web.UI.UserControl
This is set in a library. A different project uses that control in a page:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="mypage.aspx.vb"
Inherits="myproject.mypage" culture="auto" meta:resourcekey="Page" uiculture="auto"
Transaction="RequiresNew" MasterPageFile="Mynamespace.Master"
Theme="ThemeBase2" StylesheetTheme="ThemeBase2" %>
<%@ Register tagprefix="Controls" tagname="MyControl" src="../Controls/MyControl.ascx" %>
<%-- some asp.net --%>
<Controls:MyControl ID="mycontrol1" runat="server"
MyCustomProperty="value" />
However, when I build, I get an error saying
'MyCustomProperty' is not a member of 'System.Web.UI.UserControl'.
And in the designer.vb page I see:
Protected WithEvents mycontrol1 As Global.System.Web.UI.UserControl
How do I ensure it becomes:
Protected WithEvents mycontrol1 As Global.Mynamespace.Controls.MyControl
?