按钮不起作用与更新面板 [英] Button is not working with Update Panel

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

问题描述

我已经放置了一个计时器和用于显示倒计时时间在一个更新面板的标签。我已经把下一个按钮,显示下一个问题的更新面板之外。

I have placed a timer and a label for displaying countdown time in an update panel. I have placed the next button for displaying the next question outside the update panel.

我的问题是,按一下按钮不工作与更新面板。如果不使用更新面板和它的作品很好的计时器。我该如何解决这个问题呢?

My problem is that the button click is not working with the update panel. Without using the update panel and the timer it works well. How can I solve the problem?

我也试图把整个工具的更新面板内。它并没有帮助我。

I have also tried to place whole tools inside the update panel. It didn't help me.

这是我的code:

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
  <ContentTemplate>
    <table class="style1">
        <tr>
            <td class="style2">
                <asp:Timer ID="Timer1" runat="server" Interval="1000" ontick="Timer1_Tick">
                </asp:Timer>
                <asp:Label ID="lblTimer" runat="server"></asp:Label>
        </tr>
        <tr>
            <td style="margin-left: 40px" class="style3">
                <asp:Label ID="lblQuestion" runat="server"></asp:Label>
            </td>
        </tr>
        </table>
         </ContentTemplate>
                 </asp:UpdatePanel>
        <table>
        <tr>
            <td style="margin-left: 40px" class="style2">
                <asp:RadioButtonList ID="rblOptions" runat="server">
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr>
            <td style="margin-left: 40px" class="style2">
                <table class="style1">
                    <tr>
                        <td class="style2">
                            <asp:Button ID="btnNext" runat="server" onclick="btnNext_Click" Text="Next"
                                    Width="75px" />
                        </td>
                        <td>

                            <asp:Button ID="btnFinish" runat="server" onclick="btnFinish_Click"
                                Text="Finish" Width="75px" />
                        </td>
                    </tr>
                    <tr>
                        <td class="style2">
                            &nbsp;</td>
                        <td>
                         <asp:Label ID="lblScore" runat="server">Score : </asp:Label>
                       </td>
                   </tr>
                </table>
            </td>
        </tr>
    </table>
<asp:UpdatePanel>

我增加了以下code。

I added the following code.

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

不过它没有工作。能否请你帮我......

Still it didn't work. Could you please help me....

单选按钮的选择是使用更新面板时自动清零。任何帮助......?

The selection of radio button is automatically cleared when using update panel. Any help....?

感谢你......

推荐答案

如果您使用的是母版页,然后在你的页面加载事件中添加这个code

If you are using master page , then add this code in you're page load event

using AjaxControlToolkit;

ToolkitScriptManager objScriptManager = (ToolkitScriptManager)this.Master.FindControl("ScriptManager1");
    objScriptManager.AsyncPostBackTimeout = 36000;

..............

..............

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

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