F
Felix Chan
Hi all,
I have a problem in getting the selected item of a listbox
inside a custom WebControl.
I have a class 'SelectionBox', a abstract
class 'WebElement' and a interface 'IWebElement'.
The SelectionBox implment the WebElement and the
WebElement extend the WebControl class and implement
the'IWebElement', as follow:
public class SelectionBox : WebElement
{
private ListBox listBox = new ListBox();
//the body of this class were skipped
}
public abstract class WebElement : WebControl,
INamingContainer, IWebElement
{
protected int deviceID = 0;
protected int deviceType = 0;
//getter and setter of deviceID and deviceType skipped.
}
public interface IWebElement
{
int deviceID
{
get;
set;
}
int deviceType
{
get;
set;
}
}
I add the SelectionBox to a ASPX page. When postback, the
selectedindex and selecteditem of the listbox inside the
SelectionBox are always -1 and null.
I have installed the SelectIndexChanged event handler for
that listbox (inside the SelectionBox) but the value
logged to log file showing that it is -1 and null.
Anyone know why ?
Any idea of what area I should look into ?
Regards
Felix
I have a problem in getting the selected item of a listbox
inside a custom WebControl.
I have a class 'SelectionBox', a abstract
class 'WebElement' and a interface 'IWebElement'.
The SelectionBox implment the WebElement and the
WebElement extend the WebControl class and implement
the'IWebElement', as follow:
public class SelectionBox : WebElement
{
private ListBox listBox = new ListBox();
//the body of this class were skipped
}
public abstract class WebElement : WebControl,
INamingContainer, IWebElement
{
protected int deviceID = 0;
protected int deviceType = 0;
//getter and setter of deviceID and deviceType skipped.
}
public interface IWebElement
{
int deviceID
{
get;
set;
}
int deviceType
{
get;
set;
}
}
I add the SelectionBox to a ASPX page. When postback, the
selectedindex and selecteditem of the listbox inside the
SelectionBox are always -1 and null.
I have installed the SelectIndexChanged event handler for
that listbox (inside the SelectionBox) but the value
logged to log file showing that it is -1 and null.
Anyone know why ?
Any idea of what area I should look into ?
Regards
Felix