Yes I did. Here is the code.
protected override void CreateChildControls()
{
foreach(string st in this.GlobalArrayList)
{
TheListBox.Items.Add(st) ;
}
TheListBox.Attributes.Add("AutoPostBack","True") ;
TheListBox.Attributes.Add("id","ListBoxCheck") ;
TheListBox.Attributes.Add("runat","server") ;
TheListBox.Attributes.Add("OnSelectedIndexChanged" ,"TheListBox_SelectedIndexChanged")
;
this.Controls.Add(TheListBox) ;
Button TheButton = new Button() ;
TheButton.Click +=new EventHandler(TheButton_Click);
this.Controls.Add(TheButton) ;
//base.CreateChildControls ();
}
But still the TheListBox_SelectedIndexChanged function is not being called.
I am using the CreateChildControls() function to create my controls and I am
not overiding and using the render function.
Will this cause an issue?
Thank
Anand
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:ek**************@TK2MSFTNGP14.phx.gbl...
did you set the AutoPostBack property to true?
<asp:listbox ... AutoPostBack="True" />
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"msnews.microsoft.com" <ag*****@nobel-systems.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl... Hi All,
I am creating a control with ASP "ListBox" control.
Also I have added necessary code to handle the
ListBox.SelectedItemChanged Event.
But surprisingly the control is not comng to this code at all.
Why my ListBox Control in my Web Control is not Raising the
SelectedIndexChanged Event ?
Any suggestions please?
Thanks
Anand Ganesh