我创建了一个使用脚手架选项创建operation.I只是试图加载到jquery ui Dialog.I能够加载部分视图(MVC4)加载我失去了MVC 4为我生成的所有验证。AJAX加载scafolded MVC 4局部视图
是否有可能将部分视图(脚手架)加载到jQuery对话框?
这里是我已经使用了弹出
$(function() {
$("#CreateDialog").dialog({
autoOpen: false,
buttons: {
"Create": function() {
$(this).dialog("close");
}
},
dialogClass: "no-title",
hide: {
effect: "scale",
easing: "easeInBack"
},
show: {
effect: "scale",
easing: "easeOutBack"
}
});
});
function openModalPopUp() {
$.ajax({
type: 'GET',
url: '/Expense/CreatePartial',
cache: false,
success: function (result) {
$('#CreateDialog').html(result);
}
});
$("#CreateDialog").dialog("open");
}
和我的模型(样本)代码:
@model EFMvcWebRole.Models.ExpenseEntity
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>ExpenseEntity</legend>
<div class="editor-label">
@Html.LabelFor(model => model.ECValue)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.ECValue)
@Html.ValidationMessageFor(model => model.ECValue)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Category)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Category)
@Html.ValidationMessageFor(model => model.Category)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.TotalSalary)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.TotalSalary)
@Html.ValidationMessageFor(model => model.TotalSalary)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Remaining)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Remaining)
@Html.ValidationMessageFor(model => model.Remaining)
</div>
</fieldset>
你提交使用提交按钮或任何按钮的onclick事件用ajax发送数据的形式。 请向我展示您的提交代码。 – 2014-09-15 05:04:55