Asp:按钮没有在引导Tab Panes中触发

时间:2015-11-30 19:46:21

标签: c# asp.net twitter-bootstrap-3 webforms

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

我知道代码的工作方式不会出现在每次都可以使用的选项卡窗格中。 但它用于用户控制页面,最好在选项卡窗格中提供功能。

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

以下是HTML标记:

data(iris)

fmla <- as.formula(paste("Species ~", 
               paste(grep("Width", names(iris), value = TRUE), collapse = " + ")))

glm(fmla, data = iris, family = binomial(link = "logit"))

按钮事件的C#代码:

        <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>

我哪里错了? 任何帮助将不胜感激

0 个答案:

没有答案