按钮不起作用与更新面板按钮、不起作用、面板

2023-09-10 16:41:02 作者:少年学弟°

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

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;

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

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