System.Web.Mvc.ViewPagepublic ActionResult Index(){IDictionary entity = new Dictionary();//声明一个字典健值对List lpc = new List();//实体一List lsp = new List();/...
分类:
Web程序 时间:
2014-10-29 16:37:04
阅读次数:
271
当点击提交按钮后,想在Controll里取到Form里的数据。必须在控件上设置name属性 例如,在controll的Action里接收如下 public ActionResult Login(FormCollection form) { string userid=form["userID"]; ...
分类:
Web程序 时间:
2014-10-28 19:22:06
阅读次数:
113
[HttpPost] public ActionResult Create(Users user) { ModelState.Remove(“Password”); //加上这句就行了 if (ModelStat...
分类:
Web程序 时间:
2014-10-28 15:25:07
阅读次数:
166
2 System.Web.Mvc V 4.0.0.0 组件分析 2.1 Routing组件(路由选择) Routing的作用就是负责分析Url Action的要求? 必须是一个公有方法? 必须返回ActionResult类型? 必须是实例方法? 不能是范型方法? 没有标注NonActionAttri...
分类:
Web程序 时间:
2014-10-27 22:47:11
阅读次数:
320
之前写过一篇文章Jquery Ajax方法传值到action,本文是对该文的补充。假设 controller中的方法是如下:public ActionResult ReadPerson(PersonModel model) { string s = mod...
分类:
Web程序 时间:
2014-10-24 18:39:48
阅读次数:
307
这种问题有两种方案方案一:[ValidateInput(false)] public ActionResult Index() { string ss = Request["rec"]; //客户端输入了res= return View(); }方案二:在WebConfig中配置:...
分类:
Web程序 时间:
2014-10-21 12:11:10
阅读次数:
417
改天我在写详细注释吧,代码先贴出来,注释很明白了,应该无需多言。 1 Controller代码: 2 public ActionResult ForgotPassword() 3 { 4 return View(); 5 } 6 ...
分类:
其他好文 时间:
2014-10-20 00:45:44
阅读次数:
231
1、统一JSON格式处理方式,同时指定ContentType类型,解决低版本浏览器获取json时ContentType为application/json提示下载的问题. public abstract class CustomResult : ActionResult { pub...
分类:
Web程序 时间:
2014-10-18 19:35:03
阅读次数:
209
1. 返回ViewResult public ActionResult Index() { ViewData["Message"] = "Welcome to asp.net MVC!"; return View(); } public ActionResult Index(){ ViewData[...
分类:
Web程序 时间:
2014-10-15 15:59:00
阅读次数:
209
1 public ActionResult Index(string movieGenre, string searchString) 2 { 3 var GenreLst = new List(); 4 5 var GenreQry = from d in db.Mo...
分类:
Web程序 时间:
2014-10-13 17:59:19
阅读次数:
314