开发者

Bizarre updatepanel problem

I have an updatepanel, with a bunch of things in that are generat开发者_如何学Ced dynamically.

Among them are textboxes, and checkboxes. Each is created in code with Textbox t = new Textbox() and Checkbox c = new Checkbox and are added withotu altering any other properties.

Later on when I hit "Save", I get the values. The Textbox value is whatever I typed in before I hit the save button, but the Checkbox is always false regardless of whether I checked it or not.

Is there any explanation for this discrepancy?


Another problem solved after hours of debugging... I fixed a problem a couple of days ago that was caused because my controls didnt have an ID when they were dynamically generated. I read somewhere that controls without IDs sometimes behave oddly...

So in this case I gave my controls (checkboxes, not the textboxes) a random GUID, but it changed every time they were redrawn, which confused the viewstate and meant it couldnt preserve the contents.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜