ajax - Gridview TemplateField checkbox postback behavior in asp.net -
i have gridview inside updatepanel , updatemode of updatepanel set conditional.
gridview contains asp:checkbox templatefield , rest of columns boundfields dynamically created. checbox autopostback set true , update datatable (which inside session) based on checkbox value.
here markup:
<asp:gridview id="objlist" runat="server" cssclass="objlist" autogeneratecolumns="false" onrowdatabound="objlist_rowdatabound" autogenerateselectbutton="false" allowpaging="false"> <columns> <asp:templatefield headertext=" "> <headertemplate> <asp:checkbox autopostback="true" id="chkall" runat="server" oncheckedchanged="headerchk_changed" /> <asp:hiddenfield id="linknumindexhead" runat="server" value="-1" /> </headertemplate> <itemtemplate> <asp:checkbox autopostback="true" id="chkrow" runat="server" checked='<%# databinder.eval(container.dataitem, "selection")%>' oncheckedchanged="chkrow_oncheckchange" /> </itemtemplate> </asp:templatefield> </columns> </asp:gridview>
in deployed version only: whenever user click 2 or more checkboxes in fast speed. postback of first checkbox fires , rest of checkboxes unchecked. how can control behavior?
when local iis running: postback of every checkbox fires.
in firebug debugging noticed postback of first checkbox takes quite time. please tell me how can avoid situation.
try this
<asp:gridview id="objlist" runat="server" cssclass="objlist" autogeneratecolumns="false" onrowdatabound="objlist_rowdatabound" autogenerateselectbutton="false" allowpaging="false"> <columns> <asp:templatefield headertext=" "> <headertemplate> <asp:updatepanel runat="server"> <contenttemplate> <asp:checkbox autopostback="true" id="chkall" runat="server" oncheckedchanged="headerchk_changed" /> </contenttemplate> </asp:updatepanel> <asp:hiddenfield id="linknumindexhead" runat="server" value="-1" /> </headertemplate> <itemtemplate> <asp:updatepanel id="updatepanel5" runat="server"> <contenttemplate> <asp:checkbox autopostback="true" id="chkrow" runat="server" checked='<%# databinder.eval(container.dataitem, "selection")%>' oncheckedchanged="chkrow_oncheckchange" /> </contenttemplate> </asp:updatepanel> </itemtemplate> </asp:templatefield> </columns> </asp:gridview>
Comments
Post a Comment