我想在ajax调用中传递下拉列表的Htmlhelper帮助值
@Html.DropDownListFor(m => m.LanguageRouteName, (SelectList)ViewBag.LanguageEnum, new { @onchange = "submitform(event)", @class = "input-medium", @id = "languageEnum" })
我正在尝试传递该事件,但我需要HtmlHelper' helper'的所有值。我如何获得这个价值?请帮忙
答案 0 :(得分:0)
$( '#languageEnum')。平变化(函数(){
var ddl val = $('#languageEnum')。val();
$。AJAX({ 键入:“GET”,// GET或POST或PUT或DELETE动词
url: ajaxUrl, // Location of the service
data: "ddldata:ddl", // dropdown data
dataType: "json", //Expected data format from server
success: function (json) {//On Successful service call
var result = json.name;
$("#dvAjax").html(result);
}
})
});