C# 使用MVC和CRUD的jquery ui对话框
我想实现一些jQueryUI对话框,但是我找不到任何好的例子来实现我想要的。我正在使用MVC4和CRUD。创建记录后,我想显示一个jquery对话框,告诉用户这已经完成,编辑也是如此。任何示例或教程都将不胜感激 在调用post之后,最好有一个jquery对话框。db.savechanges()在重定向通知用户之前已经成功 我所做的一个简单的例子 这是我的看法C# 使用MVC和CRUD的jquery ui对话框,c#,jquery,asp.net-mvc,jquery-ui-dialog,C#,Jquery,Asp.net Mvc,Jquery Ui Dialog,我想实现一些jQueryUI对话框,但是我找不到任何好的例子来实现我想要的。我正在使用MVC4和CRUD。创建记录后,我想显示一个jquery对话框,告诉用户这已经完成,编辑也是如此。任何示例或教程都将不胜感激 在调用post之后,最好有一个jquery对话框。db.savechanges()在重定向通知用户之前已经成功 我所做的一个简单的例子 这是我的看法 @model Models.customer @{ ViewBag.Title = "Create"; } <h2>Crea
@model Models.customer
@{
ViewBag.Title = "Create";
}
<h2>Create</h2>
@using (Html.BeginForm()) {
@Html.ValidationSummary(true)
<fieldset>
<legend>customer</legend>
@Html.EditorForModel()
</fieldset>
<div id="submitCreateButton">
<input type="submit" value="Create" />
</div>
}
<div id="backToListLink">
@Html.ActionLink("Back to List", "Index",new { conName = ViewBag.connectionName }, null)
</div>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}
将ajax选项添加到表单中,该表单调用对话框,如下所示
@using (Html.BeginForm("action", "controller", new AjaxOptions{OnSuccess = "handleSuccess"}))
{
}
@section scripts {
<script>
function handleSuccess(result) {
//call dialog
}
</script>
@使用(Html.BeginForm(“操作”、“控制器”、新的AjaxOptions{OnSuccess=“handleSuccess”}))
{
}
@节脚本{
函数handleSuccess(结果){
//呼叫对话框
}
@using (Html.BeginForm("action", "controller", new AjaxOptions{OnSuccess = "handleSuccess"}))
{
}
@section scripts {
<script>
function handleSuccess(result) {
//call dialog
}
</script>