Hello Everyone I am a newbie in asp.net,
I have a checkbox inside a repeater which is inside an update panel,the page flickers whenever I click the checkbox, finally found that adding the ClientIDMode="AutoID" controls the flicker and everything works fine.
I am wondering about ClientIDMode what this has to do with the flicker, went through msdn and found it generate the value of the ClientID property.
First distict the asp.net controls, from the final rendered html controls.
When you make asp.net controls you give them an ID, with this id you can address them and make change on them on code behind and with programming in general.
For example with this code
<asp:CheckBox id="check1" Text="option a" runat="server" />
you can use the check1
to get their value, change the text, and many others.
Now, asp.net must render this check box on the html page. When you make any control on an html page you must set to him a unique ID
and name
, and heres come the automatic id assignment.
asp.net take care to avoid conficts between final rendered controls and make automatic ids base on the structure that you have use on asp.net side.
For example, if this control is inside a custom control, and this control is inside a master page, asp.net will add also this names on the final id, to avoid conflicts.
Conflicts can exist for example on a repeated control, where you render the same control many times, so there you need to change each rendered id.
Conflicts can exist when you use many times the same user control.
Conflicts can exist when you use the same id on different user controls on the same page.
All that and many others asp.net comes and solve with the automatic generated id on client side render.
Yes, it does have something to do with the flicker.
See this related question for another example of the fact that Repeaters don't handle client ids well, causing exactly this problem because they end up doing a full postback instead of a partial postback.
Setting ClientIDMode="AutoID"
is the workaround and allows the Repeater to succeed in doing the partial postack it is supposed to be doing from within the UpdatePanel.
Because of this Repeater bug, without ClientIDMode="AutoID"
you were experiencing a full postback and full page load. A full page load does cause a flicker compared to a partial page load.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With