ASP.NET MVC3 异步刷新

今天就讲讲如何在ASP.NET MVC3中实现异步刷新。本次实例前台采用的是Razor引擎。首先看看系统结构,如图

本系统采用N Layer开发。我们以其中的某个具体模块作为案例来讲述。
@model TeacherPlatForm.Utility.PagedList<TeacherPlatForm.Domain.Entities.Generate.TASE_Thesis_Titles>
<!DOCTYPE html>
<html>
<head>
       <title>论文题目发布</title>
       <linkrel="Stylesheet"type="text/css"href="../../Content/Site.css"/>
       <scripttype="text/javascript"src="../../Scripts/jquery-1.4.4.js"></script>
       <scripttype="text/javascript"src="../../Scripts/jquery.unobtrusive-ajax.min.js"></script>
       <linkrel="Stylesheet"type="text/css"href="../../Scripts/jquery.autocomplete.css"/>
       <scripttype="text/javascript"src="../../Scripts/jquery.autocomplete.js"></script>
       <scripttype="text/javascript"src="../../Scripts/common.js"></script>
       <scripttype="text/javascript"src="../../Scripts/teacherplat/thesistitlepublish.js"></script>
</head>
<body>
       <divalign="center">
               <divalign="left"style="width: 96%; margin-top: 20px">
                       当前位置:论文题目发布
                       <br/>
                       <hralign="left"noshade="noshade"size="0.1"color="#b70005"/>
               </div>
               <inputtype="hidden"id="hfd_professional"value="@ViewBag.professional"/>
               <inputtype="hidden"id="hfd_educationLevel"value="@ViewBag.educationId"/>
               <inputtype="hidden"id="hfd_write_batchid"name="hfd_write_batchid"value="@ViewBag.writeBatchid"/>
               @using (Ajax.BeginForm("ThesisOperation", "ThesisTitlePublish", new AjaxOptions { OnSuccess = "opersuccess()" }))
               {
                       Html.RenderPartial("~/Views/TeacherPlatForm/ThesisTitlePartial.cshtml");
                       <inputtype="hidden"id="hfd_sign"name="hfd_sign"/>
                       <div>
                               <input type="button" id="btnAdd" name="btnAdd" value="增加" class="btn" style="width: 60px"
                                        />  
                               <input type="button" id="btnRemove" name="btnRemove" value="删除" class="btn" style="width: 60px"
                                        />  
                               <input type="button" id="btnPublish" name="btnPublish" value="发布" class="btn" style="width: 60px"
                                        />
                       </div>
               }
       </div>
</body>
</html>

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

Grow your business fast with

Suku