I have a custom control that mimics to some extent the built in ASP.Net CheckboxList control. On the render event I generate a UL>LI>Checkbox#customId structure based on the DataSource the control is getting.
My biggest puzzle is that, even though the input HTML elements get rendered on the page, when submitting back the page, the Request.Form collection has no data related to these inputs.
So, my question is this:
Once a PostBack is triggered, is there a way to get the inputs checked by the user?
Thanks in advance,
Kali
Typically, a custom server control will implement the
SaveViewState,LoadViewState, andTrackViewStatemethods to manage the state of controls.I don’t know how you’re control is built so I can’t give you the exact code, but here’s an example of those methods being used in a control that I created:
Aside from the above methods, if you want to reload information from the
Requestobject, you can implement theIPostBackDataHandlerinterface, which requires these two methods: