我有点麻烦了解如何将事件连接到ajax.begin表单。Kendo DropDownList事件连线到Ajax.BeginForm提交
我想完成的是这个,我有一个下拉列表,拉出一个经销商列表。
基于那个经销商,我想加载一个局部视图。我的模型有一个CurrentReseller字段,包含我需要的所有信息,但我不确定如何根据他们选择的内容来改变价值。
现在我知道我可以通过常规的jQuery来做到这一点,但我对JavaScript或JQuery知之甚少,无法知道如何做到这一点。
这里就是我有我的CSHTML页
@using (Ajax.BeginForm("RenderPartials", "Admin", new AjaxOptions {
UpdateTargetId = "SellerWebSettings",
HttpMethod = "POST",
InsertionMode = InsertionMode.Replace,
LoadingElementId = "AjaxLoading",
LoadingElementDuration = 500
})) {
Html.Kendo().DropDownListFor(rs => rs.CurrentReseller)
.Name("CurReseller")
.DataTextField("Name")
.DataValueField("Name")
.Events(e => e.Change("OnCurResellerChanged"))//this is event that will ultimately render a new partial, i want this to trigger the "RenderPartials" ajax form.
.DataSource(source => {
source.Read(read => {
read.Action("GetResellers", "Admin");
});
}).OptionLabel("-- Select a Reseller --");
}
<div id="SellerWebSettings"></div>
我如何告诉“更改事件”做了ajax表单提交与Ajax.BeginForm()?
谢谢,我不认为这是简单的。显示了我对JS和jQuery的了解程度......我猜想,有时候需要更多的Pluralsight视频。 :) – brentlyjdavid