Button_ click无法使用更新面板。任何人都可以帮我解决这个问题吗? [英] Button_ click is not working with update panel .can anyone help me to solve this problem?

查看:46
本文介绍了Button_ click无法使用更新面板。任何人都可以帮我解决这个问题吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="true">

                   <ContentTemplate>
                   <div style="width:100%;">
                   <table id="tab1">
                   <tr>

                   <td >
                   <panel>
                   <div style=" padding:3px,3px,3px,3px" class="divc"><asp:Label runat="server"

                           ID="divh1" Font-Bold="True" Font-Names="Times New Roman" Font-Size="Medium" ></asp:Label></div>
                   <div style=" padding:3px 3px 3px 3px;" class="divc">
                   <asp:Label runat="server" ID="buy1" class="buylab"  Width="108px" Height="30px"

                           style=" text-align:center" BackColor="#993333" BorderStyle="None"

                           Font-Names="Times New Roman"  Font-Size="Medium" ></asp:Label>
                       <asp:Label runat="server" ID="sell1" class="buylab"  Width="106px" Height="30px"

                           style=" text-align:center;" BackColor="#009999" BorderStyle="None"

                           Font-Names="Times New Roman" Font-Size="Medium" ></asp:Label>
                   </div>
                   <div style=" padding:3px,3px,3px,3px" class="divc" >
                    <asp:Button ID="Button2" runat="server" Text="Buy" class="btnbuy" Width="109px"  UseSubmitBehavior="False"

                           BackColor="#666666" BorderStyle="Solid" BorderColor="#FF6600" onclick="Button2_Click"

                           ></asp:Button>
                    <asp:Button ID="Button3" runat="server" Text="Sell" class="btnbuy"

                           Width="111px"  BackColor="#666666" BorderStyle="Solid"

                           BorderColor="#FF6600" UseSubmitBehavior="False"></asp:Button>
                   </div>
                   <div class="divc"><asp:Label runat="server" ID="low1" Height="25px" style=" padding:1px;" Width="70px"></asp:Label>
                       <asp:Label runat="server" ID="av1" Height="25px" Width="70px" style=" padding:1px;" ></asp:Label>
                       <asp:Label runat="server" ID="high1" Height="25px" Width="70px" style=" padding:1px;"></asp:Label></div>
                   </panel>




</ContentTemplate>
                       <Triggers >
                       <asp:AsyncPostBackTrigger  ControlID="UpdateTimer" EventName="Tick" />
                       <asp:PostBackTrigger  ControlID="Button2" />

                       </Triggers>

                        </asp:UpdatePanel>

推荐答案

1。首先检查您的网站是否是启用Ajax的网站。如果没有,那么添加新的启用Ajax的网站并从web.config中复制丢失的标签,并将其放在项目web.config中,以确保它是启​​用Ajax的网站。



2.在ScriptManager中设置EnablePartialRendering =true。

3.立即在更新面板中删除您正在使用的触发器。
1. First check whether your website is Ajax enabled website. If not then add new Ajax enabled website and copy the missing tags from web.config and put it in your project web.config to make sure it is Ajax enabled website.

2.Set EnablePartialRendering="true" in your ScriptManager.
3.Remove the triggers you are using it now in your update panel.


这篇关于Button_ click无法使用更新面板。任何人都可以帮我解决这个问题吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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