Updatepannel问题请求未完成 [英] Updatepannel Problem request not getting completed

查看:71
本文介绍了Updatepannel问题请求未完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用更新的pannel并且在这里我使用gridview它包含复选框如果它检查我在数据库中进行一些修改



但实际上会发生什么用户快速检查复选框只有第一次请求执行或者可能是1然后是第3次然后是第5次执行



任何人都可以帮助我



 <   asp:ScriptManager     ID   =  ScriptManager1    runat   =   server    AsyncPostBackTimeout  < span class =code-keyword> =  360000    EnablePageMethods   =  true < span class =code-attribute>   ScriptMode   = 发布 >  
< / asp:ScriptManager >




< asp:UpdatePanel ID = UpdatePanel3 runat = 服务器 >
< span class =code-keyword>< ContentTemplate >
< asp:GridView ID = grdMember runat = 服务器 CssClass = 网格 AutoGenerateColumns = False
< span class =code-attribute> OnRowDeleting < span class =code-keyword> = grdMember_RowDeleting >
< >
< asp:TemplateField < span class =code-attribute> HeaderText = 序列号 >
< ItemTemplate >
< asp:HiddenField ID = hdfAttendace_ID =' <% #Eval( Attendace_ID)%>' runat = server / >
<%#((GridViewRow)容器).RowIndex + 1 %>
< / ItemTemplate >
< / asp:TemplateField >

< asp:TemplateField HeaderText = 参加 ItemStyle-Wrap = false >
< HeaderTemplate >
< span class =code-keyword>< asp:CheckBox runat = server ID = chkAll AutoPostBack = < span class =code-keyword> true OnCheckedChanged = onAllCheck
< span class =code-attribute> < span class =code-attribute> 文字 = 参加了 / >
< / HeaderTemplate >
< ItemTemplate >
< asp:CheckBox runat = server ID = chkIsAttend AutoPostBack = true OnCheckedChanged = onChange
< span class =code-attribute> < span class =code-attribute> < span class =code-attribute> 已检查 =' <%#Convert.ToBoolean(Eval( ISAttend))%>' / >
< / ItemTemplate >
< ItemStyle 换行 = 错误 / >
< / asp:TemplateField >

< /列 >
< EmptyDataTemplate >
未找到其他详细信息< / EmptyDataTemplate >
< / asp:GridView >
< / ContentTemplate >
< / asp:UpdatePanel >

解决方案

  on  rowdatabound事件注册您的控件  scriptmanager 

LinkBut​​ton lb1 = e.Row.FindControl( lnkbtnPhotoaddupload)< span class =code-keyword> as LinkBut​​ton;
ScriptManager.GetCurrent(this).RegisterPostBackControl(lb1);

as 保持简单的scriptmanager 所有代码 updatepanel


Insted of

简单的scriptmanager使用



 <   asp:ToolkitScriptManager     ID   =  ToolkitScriptManager1    runat   =  server >  
< / asp:ToolkitScriptManage r >





现在可以使用


I have use updated pannel and with in this i have use gridview it contains checkbox if it checked i am doing some modification in database

but actually what happens if user check checkbox fast rapidly only first request get executed or might be 1 then 3rd then 5th get execute

can any one help me

<asp:ScriptManager ID="ScriptManager1" runat="server" AsyncPostBackTimeout="360000" EnablePageMethods="true" ScriptMode="Release">
  </asp:ScriptManager>




 <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                                              <ContentTemplate>
                                                  <asp:GridView ID="grdMember" runat="server" CssClass="Grid" AutoGenerateColumns="False"
                                                      OnRowDeleting="grdMember_RowDeleting">
                                                      <Columns>
                                                          <asp:TemplateField HeaderText="Serial No">
                                                              <ItemTemplate>
                                                                  <asp:HiddenField ID="hdfAttendace_ID" Value='<%#Eval("Attendace_ID") %>' runat="server" />
                                                                  <%# ((GridViewRow)Container).RowIndex + 1%>
                                                              </ItemTemplate>
                                                          </asp:TemplateField>

                                                          <asp:TemplateField HeaderText="Attended" ItemStyle-Wrap="false">
                                                              <HeaderTemplate>
                                                                  <asp:CheckBox runat="server" ID="chkAll" AutoPostBack="true" OnCheckedChanged="onAllCheck"
                                                                      Text="Attended" />
                                                              </HeaderTemplate>
                                                              <ItemTemplate>
                                                                  <asp:CheckBox runat="server" ID="chkIsAttend" AutoPostBack="true" OnCheckedChanged="onChange"
                                                                      Checked='<%# Convert.ToBoolean(Eval("ISAttend")) %>' />
                                                              </ItemTemplate>
                                                              <ItemStyle Wrap="False" />
                                                          </asp:TemplateField>

                                                      </Columns>
                                                      <EmptyDataTemplate>
                                                          No Other Details found</EmptyDataTemplate>
                                                  </asp:GridView>
                                              </ContentTemplate>
                                          </asp:UpdatePanel>

解决方案

on rowdatabound event register your control to scriptmanager

LinkButton lb1 = e.Row.FindControl("lnkbtnPhotoaddupload") as LinkButton;
                ScriptManager.GetCurrent(this).RegisterPostBackControl(lb1);

as like this and keep simple scriptmanager and put all the code in the updatepanel


Insted of
simple scriptmanager use

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
                </asp:ToolkitScriptManager>



it will work now


这篇关于Updatepannel问题请求未完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆