User control and event problem!
-
Hi, I have a user control with 2 DropDownLists. Inside the user control, I have an event :
If (dropdownlist1.SelectedIndex == 0) dropdonwnlis2.SelectedIndex = 0;
I fisrt included the user control into a page test.aspx. The event worked fine. (ie. When i choose the fisrt item of the first dropdownlist, the selected item of the second dropdownlist is set to the first.) But when I included it in another page, all worked fine, except that event! What would be the problem??? It just seems so strange. Thanks!! -
Hi, I have a user control with 2 DropDownLists. Inside the user control, I have an event :
If (dropdownlist1.SelectedIndex == 0) dropdonwnlis2.SelectedIndex = 0;
I fisrt included the user control into a page test.aspx. The event worked fine. (ie. When i choose the fisrt item of the first dropdownlist, the selected item of the second dropdownlist is set to the first.) But when I included it in another page, all worked fine, except that event! What would be the problem??? It just seems so strange. Thanks!!you could just be missing the runat="server" tag. Or in manny cases (a bugg by microsoft) the Visual Studio .Net removes the
this.dropdownlist1.SelectedIndexChanged += new System.EventHandler(this.dropdownlist1_SelectedIndexChanged);
from theprivate void InitializeComponent()
Hope it helps Thomas -
you could just be missing the runat="server" tag. Or in manny cases (a bugg by microsoft) the Visual Studio .Net removes the
this.dropdownlist1.SelectedIndexChanged += new System.EventHandler(this.dropdownlist1_SelectedIndexChanged);
from theprivate void InitializeComponent()
Hope it helps Thomas -
Thanks first, Curiously, as I said, the control is 100% functional in one page (test.aspx). I have the problem in another page (even in the latter page, the AutoPostBack works fine!) The runat=server is just there. Everything seems OK. ?! Thanks!!