B
b_gul_t
Hi,
I have a simple web page containing a listbox, a button and a label. I load
the listbox items in codebehind such as this:
Page_load
{
if (!page.ispostback)
{
filllistbox()
}
}
When a list item is selected and the button is pressed, I want to display
the selected item in the label. The problem is, when the button is pressed
all the values in the listbox are lost, and the selectedindex is -1. Why does
it happen, how can I persist the selectedindex value? I am stuck at this for
several days, any help will be appreciated.
Thanks,
Bilge Gul
I have a simple web page containing a listbox, a button and a label. I load
the listbox items in codebehind such as this:
Page_load
{
if (!page.ispostback)
{
filllistbox()
}
}
When a list item is selected and the button is pressed, I want to display
the selected item in the label. The problem is, when the button is pressed
all the values in the listbox are lost, and the selectedindex is -1. Why does
it happen, how can I persist the selectedindex value? I am stuck at this for
several days, any help will be appreciated.
Thanks,
Bilge Gul