VS '12 asp.net C#mvc Internet App + Kendo UI,EF Code First,Kendo UI
使用Kendo DDL
@(Html.Kendo().DropDownList()
.Name("dropdownlist")
.BindTo(new string[] { "Leasehold A", "Mineral Owner", "Prospect", "StrangerInTitleNote", "StrangerInTitleNoteInfo", "StrangerLeasingNote", "StrangerLeasingNoteInfo", "Subject To", "Surface Note", "Surface Note Info", "Unreleased Mortage", "Unreleased Oil and Gas Leasors", "Vesting Note" })
)
很简单吧? - 现在我想提取所选项目并将其放入Actionlink
@Html.ActionLink("Create New", "Create", new { id = } )', null) ....
我在id=
点放置什么?我怎样才能让它发挥作用。谢谢你的回答。
PS:到目前为止,对于大量或任何HTML不熟悉MVC,我必须使用脚本吗? - 我最好不要离开这个观点。
答案 0 :(得分:2)
这是链接:
@Html.ActionLink("Click Me", "YourAction", new { controller = "YourController"}, new {id="YourActionLinkName"})
.click功能
$('#YourActionLinkName').click(function (e) {
var val = $("#dropdownlist").val();
var href = "/YourApp/YourController/YourAction/" + val;
this.href = ""; //clears out old href for reuse
this.href = href; //changes href value to currently slected dropdown value
});