母版页中的某些内容导致回发提交

时间:2015-05-11 04:19:36

标签: c# asp.net ajax

母版页中的某些内容导致回发提交导致AJAX失败。

我有这两个下拉列表,当.master没有在aspx指令上继承时回发。我搜遍了SO和网络,但我发现的唯一事情是有时更新面板无法使用验证控件。

    <!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>datePickerAngularTPLS</title>
    <link href="css/offline.css" rel="stylesheet" />
    <script src="scripts/jquery-1.11.3.min.js"></script>
    <script src="scripts/offline.js"></script>
</head>
<body>
    <script>
        $(function () {
            function on(evt) {
                alert("connected successfully");
            }
            function off(evt) {
                alert("connection failed");
            }
            Offline.on("up", on);
            Offline.on("off", off);
        });
    </script>
    <!-- Cordova reference, this is added to your app when it's built. -->
    <script src="cordova.js"></script>
    <script src="scripts/platformOverrides.js"></script>
    <script src="scripts/index.js"></script>
</body>
</html>

但是当我继承我的.master时,.master中的某些内容会在发布之前捕获并提交数据,这意味着整个页面都会被重新加载。

<div class="form-group">
        <asp:Label runat="server" AssociatedControlID="ddlFaculty" CssClass="col-md-2 control-label">Faculty</asp:Label>
        <div class="col-md-10">
           <asp:DropDownList ID="ddlFaculty" EnableViewState="true" class="form-control" CausesValidation="false" runat="server" AutoPostBack="true" aria-expanded="true"   OnSelectedIndexChanged="ddlFaculty_SelectedIndexChanged">
                <asp:ListItem Value="null">Select Faculty</asp:ListItem>
                    <asp:ListItem Value="Arts">Faculty of Arts</asp:ListItem>
                    <asp:ListItem Value="Business">Faculty of Business</asp:ListItem>
                    <asp:ListItem Value="Health">Faculty of Health</asp:ListItem>                      
                    <asp:ListItem Value="Industries">Faculty of Service Industries</asp:ListItem>
                    <asp:ListItem Value="Trades">Faculty of Trades</asp:ListItem>
                    <asp:ListItem Value="Maori">Te Wananga Maori</asp:ListItem>
            </asp:DropDownList>

        </div>
    </div>

    <div class="form-group">
        <asp:Label runat="server" AssociatedControlID="ddlCourse" CssClass="col-md-2 control-label">Course</asp:Label>
        <asp:Label runat="server" id="lblfaculty"></asp:Label>
        <div class="col-md-10">
            <asp:UpdatePanel runat="server" id="UpdateCourse" UpdateMode="Conditional">
                <ContentTemplate>

                    <asp:DropDownList runat="server" CssClass="form-control" ID="ddlCourse"  />
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="ddlFaculty" EventName="SelectedIndexChanged"/>
                </Triggers>
            </asp:UpdatePanel>                          
        </div>
    </div>

0 个答案:

没有答案
相关问题