Someone must have run into this before...
I user codebehind (ie setting src and inherits attribute of page declarative). When I use spaghetti code, its easy to register my user control, set the element up in html, then get the value in my script blocks on post back (set with a public property of the user control). However, when i register the control, and set it up in html on my aspx page, then try to access it on my .vb code behind, I'm having issues... Here's pretty much what i'm doing and what i've done:
webform.aspx:
and
and in webform.aspx.vb, i've tried:
and
and
the closest i've gotten is with try #1, in which i receive the following error:
Line 30: Protected WithEvents StateList1As System.Web.UI.UserControl.StateList
HELP! Thanks.
I user codebehind (ie setting src and inherits attribute of page declarative). When I use spaghetti code, its easy to register my user control, set the element up in html, then get the value in my script blocks on post back (set with a public property of the user control). However, when i register the control, and set it up in html on my aspx page, then try to access it on my .vb code behind, I'm having issues... Here's pretty much what i'm doing and what i've done:
webform.aspx:
Code:
<%@ Register TagPrefix="COUNTRIES" TagName="CountryList" Src="/bmc/Library/countries.ascx" %>
<%@ Register TagPrefix="STATES" TagName="StateList" Src="/bmc/Library/states.ascx" %>
Code:
<STATES:StateList id="StateList1" runat="server"></STATES:StateList>
<COUNTRIES:CountryList id="CountryList1" runat="server"></COUNTRIES:CountryList>
and in webform.aspx.vb, i've tried:
Code:
Protected WithEvents StateList1 As System.Web.UI.UserControl.StateList
Protected WithEvents CountryList1 As System.Web.UI.UserControl.CountryList
Code:
Protected WithEvents StateList1 As System.Web.UI.UserControl
Protected WithEvents CountryList1 As System.Web.UI.UserControl
Code:
Protected WithEvents StateList1 As StateList
Protected WithEvents CountryList1 As CountryList
the closest i've gotten is with try #1, in which i receive the following error:
Code:
Compiler Error Message: BC30002: Type 'System.Web.UI.UserControl.StateList' is not defined.
Source Error:
Line 28: Protected WithEvents txtFaxNum As System.Web.UI.WebControls.Textbox
Line 29: Protected WithEvents ddIndustry As System.Web.UI.WebControls.DropDownList
Code:
Line 31: Protected WithEvents CountryList1 As System.Web.UI.UserControl.CountryList
Line 32:
HELP! Thanks.