I am creating a Webpart which loads a custom control (.ascx) in the CreateChildControls Event
protected override void CreateChildControls(EventArgs e)
_userControl = Page.LoadControl(@"/_controltemplates/ControlTemplates/CustomUserControl.ascx");
_userControl.ID = "usrSearchResults";
In the codebehind of this user control (I am using the inherits model as in ASP.NET 1.1) I have an InitializeControls method which binds the eventhandlers to an already existing DropDownList on the user control.
Markup in the .ascx file
<asp:DropDownList ID="ddlRegions" AutoPostBack="true" runat="server" DataTextField="Title"
EventHandling code in the code behind of the user control.ÃÂ This code runs in every Page_Load event.
ddlRegions.DataBound += new EventHandler(ddlRegions_DataBound);
The problem is that when the selected values in the dropdownlist changes the event handler does not fire (a post does occur though).ÃÂ Am I missing something here?
View Complete Post