0
我的主要问题是我想用主题和按钮的下拉列表更改我的网站的引导主题。ASP.NET web表单动态改变bootstrap主题
@model IEnumerable<ProjectManagementTool.ServiceReference1.Theme>
@{
ViewBag.Title = "Settings";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<form action="/Home/Settings" method="get">
<h2>Settings</h2>
<br />
<h4>Change Theme</h4>
@Html.DropDownList("GetThemes", null, htmlAttributes: new { @class = "form-control" })
<br />
<p>
<input class="btn btn-default" type="submit" value="Save"/>
</p>
@foreach (var item in Model)
{
@Html.DisplayFor(modelItem => item.Path)
<br/>
}
</form>
foreach循环是只是为了显示有多种不同的路径。
现在的问题是,我怎么能更改引导?
我知道有这个代码来改变主题。
@Styles.Render("~/Content/flatly.bootstrap.css")
但它应该在_layout.cshtml文件中设置为整个网站。
背景与服务一起工作,但在这里并不重要。