Asp.net UpdatePanel中的按钮不会将我重定向到其他页面

Asp.net UpdatePanel中的按钮不会将我重定向到其他页面,asp.net,Asp.net,我有一个表单,其中有一个按钮,用于验证必填字段,如果验证正常,请将我发送到另一个页面。我已经将AJAX与UpdatePanel一起使用,它向我显示了一个标签(如果该字段是必需的或不是必需的)。 问题是,当我按下按钮并且验证正确时,它不会将我重定向到另一个页面 <asp:UpdatePanel ID="upn_Data" runat="server" UpdateMode="Always"> <ContentTemplate> <div class="row inp-

我有一个表单,其中有一个按钮,用于验证必填字段,如果验证正常,请将我发送到另一个页面。我已经将AJAX与UpdatePanel一起使用,它向我显示了一个标签(如果该字段是必需的或不是必需的)。 问题是,当我按下按钮并且验证正确时,它不会将我重定向到另一个页面

<asp:UpdatePanel ID="upn_Data" runat="server" UpdateMode="Always">
<ContentTemplate>
<div class="row inp-row check-field">
    <label for="option" class=" ">Option1 :*</label>
        <div class="text-inp with-tooltip">&nbsp;
            <asp:DropDownList ID="ddlOption1" runat="server" AutoPostBack="true" onselectedindexchanged="ddlOption1_SelectedIndexChanged">
            </asp:DropDownList>&nbsp;
            <asp:Label ID="lblRequiredOption1" runat="server" Text="Obligatory field" visible="false" AutoPostBack="true"></asp:Label> 
        </div>
</div>
</ContentTemplate>
</asp:UpdatePanel>


<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
<ContentTemplate>
    <div id = "buttons" class ="buttons">
    <asp:Button ID="Button1" runat="server" Text = "Continue" class="continue-btn" onclick="Button1_Click"></asp:Button>
    </div>
</ContentTemplate>
</asp:UpdatePanel>

调试器是否能够点击
按钮1\u单击
事件?或者
nextPage
的值是否始终为false?如果是,请找出原因。是的,调试器到达Button1\u click事件。还将执行指令cs.RegisterClientScriptBlock(),但它不会更改页面。如果我删除UpdatePanel中的按钮并且不使用Ajax,那么它就可以工作。但是我需要使用ajax来验证,当验证正确时,nextPage的值为true
protected void Button1_Click(object sender, EventArgs e)
{
    bool nextPage = true;

    if (ddlOption1.SelectedValue == "*")
    {
        lblRequiredOption1.Visible = true;
        nextPage = false;
    }

    if (nextPage == true) {
       Type cstype = this.GetType();
       String csName = "RedirectScript";
       String script = "window.parent.location = '../Paso2.html'";

       ClientScriptManager cs = Page.ClientScript;
       cs.RegisterClientScriptBlock(cstype, csName, script.ToString(), true);
    }
}