ASP.NET AutoPostBack来自下拉引导程序

时间:2015-04-06 22:43:48

标签: asp.net twitter-bootstrap

我遇到了AutoPostBack事件的问题。我的下拉列表的AutoPostBack不起作用。它工作正常,直到我将bootstrap引入混音。

下拉

<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="namesSQL" 
    DataTextField="Name" DataValueField="EmplID" AutoPostBack="true" 
    CssClass="form-control">
</asp:DropDownList>

SQL数据源

<asp:SqlDataSource ID="namesSQL" runat="server" 
    ConnectionString="<%$ ConnectionStrings:Myapp %>" 
    SelectCommand="SELECT EmplID, EmpName, LastName, 
    { fn CONCAT(EmpName, LastName) } AS Name 
    FROM Employees 
    ORDER BY { fn CONCAT(EmpName, LastName) }">
</asp:SqlDataSource>

数据源工作正常,我列出了它,因为我知道有人会要求它......

已更新

好的,我发现当我将该页面插入另一个主页时,它有效。这是它没有工作的主人。从原来的工作,我格式化了一些div来封装内容部分,并添加了自举链接。

<%@ Master Language="VB" CodeFile="is.master.vb" Inherits="masterPages_subMaster" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head id="Head1" runat="server">
    <title>Home</title>
    <%--<link href="~/App_Themes/default/subpage.css" rel="stylesheet"  type="text/css" media="screen" />--%>
    <link rel="shortcut icon" type="image/x-icon" href="../images/green_m.ico" />
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"  type="text/css" />

    <!-- Optional theme -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css"  type="text/css" />

    <!-- Latest compiled and minified JavaScript -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js" type="text/javascript"></script>

</head>
<body>
    <div id="container">
        <div class="col-md-10 col-md-offset-1"
            <form id="form1" runat="server">
                <nav class="navbar navbar-default">
                    <div class="container-fluid">
                        <ul class="nav navbar-nav">
                            <asp:Repeater runat="server" ID="topmenucontainer" DataSourceID="SiteMapDataSourceMainNavigation">
                                <ItemTemplate>
                                    <li >
                                     <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("url")%>'><%# Eval("Title") %></asp:HyperLink>
                                    </li>
                                </ItemTemplate>
                            </asp:Repeater>
                        </ul>
                    </div>
                </nav>
                <asp:SiteMapDataSource ID="SiteMapDataSourceMainNavigation" runat="server" ShowStartingNode="False"  SiteMapProvider="isMapProvider"/>

                <div class="row">
                    <div class="col-md-10">
                        <h1>Information Services</h1>
                        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">                  
                        </asp:ContentPlaceHolder>
                    </div>
                </div>
                <br />
                <div class="row">
                    <asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server" />
                </div>
            </form>
        </div>
    </div>
</body>
</html>

0 个答案:

没有答案