1

VS '12 asp.net C# mvc Internet App + Kendo UI,EF Code First,Kendo UI

使用剑道 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:到目前为止对MVC或任何HTML都不熟悉,我必须使用脚本吗?- 最好我不想离开视图。

4

1 回答 1

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

        });
于 2013-09-09T20:30:28.463 回答