Asp.NET MVC ajax
asp.net mvc js验证:
jquery.validate.js
<script type="text/javascript"> $(function() { $("form").validate({ errorClass: "field-validation-error", rules: { "pledge.SupporterName": { required: true, maxlength: 50 }, "pledge.SupporterEmail": { required: true, email: true }, "pledge.Amount": { required: true, min: 10 } }, messages: { "pledge.Amount": { min: "Come on, you can give at least $10.00!" } } }) }); </script>
<%-- $("form[action$='GetQuote']").submit(function() { $.post($(this).attr("action"), $(this).serialize(), function(response) { $("#results").html(response); }); return false; }); $("form[action$='GetQuote']").submit(function() { $.getJSON($(this).attr("action"), $(this).serialize(), function(stockData) { $("#openingPrice").html(stockData.OpeningPrice); $("#closingPrice").html(stockData.ClosingPrice); $("#stockRating").html(stockData.Rating); }); return false; }); --%> <%: Ajax.ActionLink("显示时间", "ShowMessage", new { username = "xxx" }, new AjaxOptions { Confirm = "确定吗", HttpMethod="Post" , UpdateTargetId = "divMsg", LoadingElementId = "dvLoading", OnSuccess="fun_suc", InsertionMode=InsertionMode.InsertAfter, OnBegin="fun_beg" })%> <div > </div>
- 上一篇 »C#结合js 上传文件和删除文件,技术点有:asp.net mvc ,nhibernate,ajax等
- 下一篇 »Razor语法&ActionResult&MVC Razor代码复用了解ASP.NET MVC几种ActionResult的本质:EmptyResult & ContentResult了解ASP.NET MVC几种ActionResult的本质:FileResult了解ASP.NET MVC几种ActionResult的本质:JavaScriptResult & JsonResult了解ASP.NET MVC几种ActionResult的本?