Problems with panels and Postback (ASP.Net)

G

Guest

Hi,
I would like to use Panels in my ASP.Net code. It works OK if I put static
controls on it but if I have a drop down list or a listbox control that need
to have 'EnablePostBack' = true then the SelectedIndexChanged event does not
fire.
In the case of the Drop down list control I get an error 'Failed to Load
ViewState etc....'
For the Listbox, I don't get this error but the SelectedIndexChanged event
is not being fired.
If the control is not loaded into the Panel, the events fire fine.
Please Help!
 
S

SevDer

I can tell one thing for the viewstate problem.
Make sure that you do not remove some controls between postbacks.

The bottom line is, if you remove a control from the code that was there
when the page loaded for the first time, you will have this viewstate
problem.

And for not firing change event, make sure that your drop down does not
become visible false in the page load before you onchange event is being
executed.

I hope I gave you some idea.
 
S

sam

yep, you are removing controls between postbacks and maybe you have the
viewstate disabled for the listbox so that's why its not giving the
error.

you need viewstate enabled for those events to fire so that explains
the other problem.

if you need any more help here please ask.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top