If I put a checkbox (or any standard control) on a blank aspx page, and a button to postback, the value of the control is saved. This is pretty standard viewstate stuff.
If I do exactly the same, but into a custom abstract (otherwise blank) webpart, the button posts back, but the viewstate does not seem to be carried over - the checkbox is unselected if selected, the textbox is blank despite having data in before postback, etc etc.
I've messed about with enabling view state, modes, etc but I think this might be something I've accidentally turned off in Kentico settings somewhere maybe? Also 'Disable view state' is definitely not checked in the webpart properties :)
Anyone point me in the right direction?
As you mentioned in our support ticket, the issue turned out to be from a duplicate div id.
I am just mentioning this for the sake of anyone with a similar issue who finds this post.
Have a great day!
Have you checked any of the containers holding the webpart i.e.: webpart zone or template properties? You can turn off viewstate there as well and it does the same for the child controls.
As I have modified the Kentico-standard Ecommerce template this could well be the case.
However I can't seem to find the global/template/webpart view state options? Could you point me in the right direction?
Haha, yes - genuinely was going to reply to this ticket but forgot.
Always check the obvious first - incompetence!
There was also a form tag (from a template we are using) which also didn't help.
Many thanks for your replies here and on support :)
Please, sign in to be able to submit a new answer.