我有以下包含 的 View @Html.DropDownList :-
<fieldset>
<legend>Answer here</legend>
<div class="editor-label">
@Html.LabelFor(model => model.Description)
</div>
<div class="editor-field" data-toggle="dropdown">
@Html.EditorFor(model => model.Description)
@Html.ValidationMessageFor(model => model.Description)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.IsRight)
</div>
<div class="editor-field">
@Html.DropDownList("IsRight", String.Empty)
@Html.ValidationMessageFor(model => model.IsRight)
</div>
</fieldset>
以及以下显示简单 的 Java 脚本提示信息 :-
<script type="text/javascript">
function removePartial2() {z
alert('Deletion was successful');
$(this).remove();
}
</script>
我已经从 bootstrap 网站下载了相关的脚本文件(bootstrap-dropdown.js 和 bootstrap-alert.js),但我不知道如何修改上面的代码,以便能够在我的 asp.net MVC 中同时使用 Bootstrap 下拉菜单和 Bootstrap 警报消息。?
BR
最佳答案
正如您在 http://twitter.github.com/bootstrap/components.html#buttonDropdowns 中看到的那样它们并不像 .net 下拉列表那样工作,因为它不保留所选值,但您可以在 javascript 中做一些变通方法。
我不会推荐它...
关于asp.net-mvc-3 - 我如何使用 Bootstrap 下拉菜单和警报而不是 @Html.DropDownList 和我的 asp.net MVC 警报,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9627630/