Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Asp:启动选项卡窗格中的按钮未触发_C#_Asp.net_Twitter Bootstrap 3_Webforms - Fatal编程技术网

C# Asp:启动选项卡窗格中的按钮未触发

C# Asp:启动选项卡窗格中的按钮未触发,c#,asp.net,twitter-bootstrap-3,webforms,C#,Asp.net,Twitter Bootstrap 3,Webforms,我已经设置了一个引导选项卡窗格,在这个选项卡窗格中有一个表单,在asp:Button上按下该代码将不会执行 我知道代码在选项卡窗格中不起作用时,每次都起作用。 但这是一个用户控件页面,最好在选项卡窗格中提供功能 这适用于选项卡窗格中的所有按钮。 如果一个问题得到解决,那么修复其他问题的方法就产生了 以下是HTML标记: <div class="tab-content col-lg-10"> <div class="tab-pane

我已经设置了一个引导选项卡窗格,在这个选项卡窗格中有一个表单,在asp:Button上按下该代码将不会执行

我知道代码在选项卡窗格中不起作用时,每次都起作用。 但这是一个用户控件页面,最好在选项卡窗格中提供功能

这适用于选项卡窗格中的所有按钮。 如果一个问题得到解决,那么修复其他问题的方法就产生了

以下是HTML标记:

        <div class="tab-content col-lg-10">
                <div class="tab-pane active" id="pane1">
                    <%--Content goes in here, so tables, and whatever else--%>
                    <h3>My Bookings</h3>
                    <div class="container">
                        <asp:GridView runat="server" ID="dgBookingView" AutoGenerateColumns="False" DataSourceID="myBookings" CssClass="table table-striped table-bordered" UseAccessibleHeader="True">
                            <Columns>
                                <asp:BoundField DataField="BookingID" HeaderText="Booking #" InsertVisible="False" SortExpression="BookingID" />


                                <asp:BoundField DataField="FilmName" HeaderText="Movie" SortExpression="FilmName" />
                                <asp:BoundField DataField="Requirements" HeaderText="Requirements" SortExpression="Requirements" />
                                <asp:BoundField DataField="Showtime" HeaderText="Time" SortExpression="Showtime" DataFormatString="{0:t}" />
                                <asp:BoundField DataField="ShowDate" HeaderText="Date" SortExpression="ShowDate" DataFormatString="{0:d}" />
                            </Columns>
                        </asp:GridView>
                        <asp:SqlDataSource ID="myBookings" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT Booking.BookingID, Booking.CustomerFK, Booking.AuditorumFK, Booking.Requirements, Film.FilmName, Showtime.Showtime, Showtime.ShowDate, Showtime.AuditoriumID, Customers.UserNameFK FROM (((((Booking INNER JOIN Seat ON Booking.BookingID = Seat.BookingFK) INNER JOIN Auditorium ON Seat.AuditoriumFK = Auditorium.AuditoriumID) INNER JOIN Showtime ON Auditorium.AuditoriumID = Showtime.AuditoriumID) INNER JOIN Film ON Showtime.FilmFK = Film.FilmID) INNER JOIN Customers ON Booking.CustomerFK = Customers.CustomerID)
WHERE([Customers.UserNameFK] = ? )">
                            <SelectParameters>
                                <asp:SessionParameter
                                    Name="userNamePa"
                                    SessionField="userName"
                                    DefaultValue="userName" />
                            </SelectParameters>
                        </asp:SqlDataSource>


                    </div>
                    <div class="row">
                        <h3>Specify any Special Requirements</h3>
                        <div class="form-horizontal">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">Booking #</label>
                                <div class="col-sm-6">
                                    <asp:TextBox runat="server" CssClass="form-control" ID="txtBookingID"></asp:TextBox>
                                </div>
                                <div class="col-sm-4">
                                    <h4>
                                        <asp:RequiredFieldValidator ID="rqfUserNameValid" ControlToValidate="txtBookingID" runat="server"
                                            ErrorMessage="Enter a Booking Number" CssClass="label label-danger">
                                        </asp:RequiredFieldValidator>
                                    </h4>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">Extra Requirements</label>
                                <div class="col-sm-6">
                                    <asp:TextBox ID="txtRequirements" class="form-control" Rows="5" runat="server"></asp:TextBox>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-6">
                                    <asp:Button runat="server" CssClass="btn btn-default" Text="Make Change" ID="btnRequirements" OnClick="btnRequirements_OnClick" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="tab-pane" id="pane2" runat="server">
                    <%--Change User Password START--%>
                    <h3>Change Password</h3>

                    <div class="form-horizontal">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">Current Password</label>
                            <div class="col-sm-6">
                                <asp:TextBox runat="server" CssClass="form-control" ID="txtCurrentPass" TextMode="Password"></asp:TextBox>

                            </div>
                            <div class="col-sm-4">
                                <h4>
                                    <asp:RequiredFieldValidator runat="server" CssClass="label label-danger" ID="rqfCurrentPassword" ControlToValidate="txtCurrentPass"
                                        ErrorMessage="Enter Current Password">
                                    </asp:RequiredFieldValidator>
                                </h4>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">New Password</label>
                            <div class="col-sm-6">
                                <asp:TextBox runat="server" CssClass="form-control" TextMode="Password" ID="txtNewPassword"></asp:TextBox>

                            </div>
                            <div class="col-sm-4">
                                <h4>
                                    <asp:RequiredFieldValidator runat="server" CssClass="label label-danger" ID="rqfNewPassword" ControlToValidate="txtNewPassword"
                                        ErrorMessage="Required">
                                    </asp:RequiredFieldValidator>
                                </h4>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">Confirm Password</label>
                            <div class="col-sm-6">
                                <asp:TextBox runat="server" CssClass="form-control" TextMode="Password" ID="txtConfirmPassword"></asp:TextBox>

                            </div>
                            <div class="col-sm-4">
                                <h4>
                                    <asp:RequiredFieldValidator runat="server" CssClass="label label-danger" ID="rqfConfirmPassword" ControlToValidate="txtConfirmPassword"
                                        ErrorMessage="Required">
                                    </asp:RequiredFieldValidator>
                                </h4>
                                <h4>
                                    <asp:CompareValidator runat="server" ControlToValidate="txtConfirmPassword" ControlToCompare="txtNewPassword" ID="PassCompare" ErrorMessage="Confirm password must match password" CssClass="label label-danger"></asp:CompareValidator>
                                </h4>
                            </div>

                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-6">
                                <asp:Button runat="server" CssClass="btn btn-default" Text="Change Password" ID="btnPasswordChange" OnClick="btnChangePassword_OnClick"></asp:Button>

                            </div>
                        </div>
                    </div>

                    <div class="col-sm-4">
                        <h4>
                            <asp:Label runat="server" CssClass="label label-danger" ID="lblPassChange" Visible="False" Text=""></asp:Label>
                        </h4>
                    </div>
                </div>
                <%--Change User Password--%>
            </div>
        </div>
我哪里做错了?
任何帮助都将被视为猜测:验证。如果使用选项卡,则需要验证的验证器和按钮应具有相同的ValidationGroup。否则,不可见的验证器将阻止表单提交,但错误将不可见。我将如何实现验证组?听起来像是引导问题,但只是为了检查,您说“在此选项卡窗格中有一个表单”。是否添加表单?如果这是在母版页上,那么这是一个问题,因为该页上只能有一个表单。验证程序上的ValidationGroup属性已解决了问题,感谢您为我指明了方向。
protected void btnChangePassword_OnClick(object sender, EventArgs eventArgs)
{
    //Changes Password of current Logged in User
    string oldPass = txtCurrentPass.Text;
    string newPass = txtNewPassword.Text;
    MembershipUser user = Membership.GetUser(User.Identity.Name);

    if (txtCurrentPass.Text == txtNewPassword.Text)
    {
        lblPassChange.Visible = true;
        lblPassChange.Text = "Old Password must not match New Password";
    }
    else
    {
        if (user != null && user.ChangePassword(oldPass, newPass))
        {
            lblPassChange.Visible = true;
            lblPassChange.Text = "Password Changed Successfully";
            lblPassChange.CssClass = "label label-success";
        }
        else
        {
            lblPassChange.Visible = true;
            lblPassChange.Text = "Error, Please try again";
        }
    }
}