摘要:
新建一个Model 1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel.DataAnnotations; 4 using System.Linq; 5 using System.Web; ... 阅读全文
摘要:
“=”号,将原封不动输出字符串到页面“:”号:将字符串进行编码后输出到页面1 public ActionResult HtmlEncodeDemo()2 {3 ViewData["strScript"] = "";4 return V... 阅读全文
摘要:
下拉列表框1 前台代码2 3 后台代码4 ViewData["City"] = new List()5 {6 new SelectListItem(){Selected=false,Text="北京",Value="1"},7 ... 阅读全文
摘要:
将ado.net的cs文件SqlHelper.cs放入解决方案 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Conf... 阅读全文
摘要:
如果确认你返回的是一个视图(view),你可以直接返回类型为ViewResult。如果你并不是很清楚,或者你根本不想去理解这些东西,你可以直接返回ActionResult 阅读全文