更新面板内的按钮导致错误 [英] Button inside update panel causing error

查看:120
本文介绍了更新面板内的按钮导致错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有人,\\ /


这是我的方案:

- 当用户点击按钮(更改部分按钮)时,它会导致出现另一个按钮(提交按钮)。我需要在updatepanel中放置提交按钮,否则当用户点击更改部分时不会显示按钮。

- 现在出现提交按钮,但是当我点击提交时,会出现此错误:



Microsoft JScript运行时错误:Sys.WebForms.PageRequestManagerParserErrorException:无法解析从服务器收到的消息。



我已尝试将change causevalid更改为false并添加

 <  触发器 < span class =code-keyword>>  
< asp:AsyncPostBackTrigger ControlID = btnSubmit EventName = <跨度class =code-keyword>点击 / >
< / Triggers >





更新面板属性但不起作用。还有其他想法如何解决这个问题吗?



 <   asp:UpdatePanel     ID   =  UpdatePanel2    runat   =  server >  
< ContentTemplate >


< div id = divSubmit runat = server < span class =code-attribute> visible = false >

< table runat = server id = tableSubmit style = width:53% >
< tr >
< td 样式 = width:114px >
选择经理< / td < span class =code-keyword>>
< td style = width:8px >
< / td >
< td style = width:183px >
< asp:DropDownList ID = ddlMgr runat = server CssClass = txtbox >
< / asp:DropDownList >
< asp:Label ID = lblddlMgr runat = server 字体大小 = 11pt

< span class =code-attribute> 文本 = 更改响应。部分不要求经理批准 可见 = False > < / asp:标签 >
< / td >
< / tr >
< tr >
< td colspan = 3 >
& nbsp; < / td >
< span class =code-keyword>< / tr >
< / table >
< asp:UpdateProgress ID = 更新ateProgress4 runat = server DynamicLayout = 错误 >
< ProgressTemplate >
< span class =code-keyword>< div align = center 样式 = font-weight:粗体 >
& nbsp; < asp:图像 ID = aspImg4 runat = server 高度 = 16px

ImageUrl = 〜/ img / loading_bar.gif 宽度 = 177px / >
正在提交... < / div < span class =code-keyword>>

< / ProgressTemplate >
< / asp: UpdateProgress >
< asp:按钮 ID = btnSubmit runat = server CssClass = 按钮 高度 = 42px

< span class =code-attribute> 文本 = 重新提交 宽度 = 202px CausesValidation = False / >
< br / >

< / div >
< / ContentTemplate >
< 触发器 >
< asp:AsyncPostBackTrigger ControlID = btnSubmit EventName = 点击 / >
< / Triggers > ;
< / asp:UpdatePanel >

解决方案

以下应该有所帮助: Sys.WebForms.PageRequestManagerParserErrorException - 它是什么以及如何避免它 [ ^ ]

Hye all,

Here is my scenario:
- When user click on a button (Change Section button), it causes another button (Submit button) to appear. I need to put the submit button inside updatepanel otherwise the button wud not be displayed when user click change section.
- Now the submit button appears, but when i click submit, this error occurs:

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.

I have tried change causevalidation to false and add

<Triggers>
           <asp:AsyncPostBackTrigger ControlID="btnSubmit" EventName="Click" />
       </Triggers>



in update panel properties but neither works. Any other idea how to solve this?

<asp:UpdatePanel ID="UpdatePanel2" runat="server">
   <ContentTemplate>


                 <div id="divSubmit" runat = "server" visible ="false">

                                  <table runat="server" id="tableSubmit" style="width: 53%">
                                      <tr>
                                          <td style="width: 114px">
                                              Select manager</td>
                                          <td style="width: 8px">
                                              :</td>
                                          <td style="width: 183px">
                                              <asp:DropDownList ID="ddlMgr" runat="server" CssClass="txtbox">
                                              </asp:DropDownList>
                                              <asp:Label ID="lblddlMgr" runat="server" Font-Size="11pt"

                                                  Text="Change Resp. Section does not require Manager's Approval" Visible="False"></asp:Label>
                                          </td>
                                      </tr>
                                      <tr>
                                          <td colspan="3">
                                              &nbsp;</td>
                                      </tr>
                                  </table>
                                  <asp:UpdateProgress ID="UpdateProgress4" runat="server" DynamicLayout="False">
                                      <ProgressTemplate>
                                          <div align="center" style="font-weight:bold">
                                              &nbsp;<asp:Image ID="aspImg4" runat="server" Height="16px"

                                                  ImageUrl="~/img/loading_bar.gif" Width="177px" />
                                              Submitting...</div>
                                      </ProgressTemplate>
                                  </asp:UpdateProgress>
                                  <asp:Button ID="btnSubmit" runat="server" CssClass="button" Height="42px"

                                      Text="Resubmit" Width="202px" CausesValidation="False" />
                                  <br />

                 </div>
</ContentTemplate>
       <Triggers>
           <asp:AsyncPostBackTrigger ControlID="btnSubmit" EventName="Click" />
       </Triggers>
   </asp:UpdatePanel>

解决方案

Following should help: Sys.WebForms.PageRequestManagerParserErrorException - what it is and how to avoid it [^]


这篇关于更新面板内的按钮导致错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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