在dropdownlist.selectedindexchanged事件上呈现包

时间:2018-06-01 16:47:03

标签: asp.net

     <webopt:bundlereference runat="server" path="~/Content/spacelab/css" Id="bundle"/>

    <asp:DropDownList ID="ddlTheme" runat="server" OnSelectedIndexChanged="ddlTheme_SelectedIndexChanged">
                                <asp:ListItem Selected Text="cerulean" Value="cerulean"></asp:ListItem>
                                <asp:ListItem  Text="cosmo" Value="cosmo"></asp:ListItem>
                            </asp:DropDownList> 
    protected void ddlTheme_SelectedIndexChanged(object sender, EventArgs e)
        {

     DropDownList ddl = (DropDownList)sender;
                if (ddl.SelectedValue == "cerulean")
                {
                    bundle.Path = "~/Content/cerulean/css";
                }
                if (ddl.SelectedValue == "cosmo")
                {
                    bundle.Path = "~/Content/cosmo/css";
                }
}

如何渲染捆绑包?

0 个答案:

没有答案