From:一条被猫抛弃的他乡流浪狗!

随笔分类 -  MVC

摘要:第一种方法:javascript控制。缺点,一般用户使用没问题,但是懂点js的还是可以强行重复提交。而且,后退再提交,你也没啥办法。 第二种方法:服务器控制。 后台生成一个token,存入session或者其他缓存里面。渲染表单时,给form一个隐藏的token(令牌). 用户提交表单时: 先判断表 阅读全文
posted @ 2017-01-03 23:48 ICE_Inspire 阅读(649) 评论(0) 推荐(2)
摘要:1.0 @helper语法 @helper语法可以定义可重复使用的帮助器方法: 例如 @helper methodName(type paramName,...){ //todo } 调用:@methodName(parma) 阅读全文
posted @ 2016-04-14 14:14 ICE_Inspire 阅读(553) 评论(1) 推荐(0)
摘要:1.0 下载并引用 log4net.dll 2.0 修改Web.config 1 <configuration> 2 <configSections> 3 <section name="log4net" type="log4net.Config.Log4NetConfigurationSection 阅读全文
posted @ 2016-02-21 16:30 ICE_Inspire 阅读(551) 评论(2) 推荐(1)
摘要:添加了mvc区域以后,可能出现以下错误... 找到多个与名为“Login”的控制器匹配的类型。如果为此请求(“{controller}/{action}/{id}”)提供服务的路由在搜索匹配此请求的控制器时没有指定命名空间,则会发生此情况。如果是这样,请通过调用含有 'namespaces' 参数的 阅读全文
posted @ 2016-01-29 16:11 ICE_Inspire 阅读(1269) 评论(2) 推荐(0)
摘要:1.0 创建Attribute using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace LSUnion.Site.WebHelper { [AttributeUsag 阅读全文
posted @ 2016-01-28 16:13 ICE_Inspire 阅读(729) 评论(0) 推荐(0)
摘要:后台代码: using Webdiyer.WebControls.Mvc; 1 public ActionResult Index(int id = 1) 2 { 3 int pageIndex = id; 4 int count; 5 int pageSize = 7; 6 7 List<News 阅读全文
posted @ 2016-01-27 10:31 ICE_Inspire 阅读(530) 评论(0) 推荐(1)
摘要:MVC 创建线程内的db单例 阅读全文
posted @ 2016-01-26 17:06 ICE_Inspire 阅读(533) 评论(4) 推荐(0)
摘要:表的一个字段:Moblie char(15)对应的mvc代码:@Html.EditorFor(c => c.Mobile) [RegularExpression("^1[3|4|5|7|8][0-9]\\d{8}$", ErrorMessage = "手机号码格式不对")] publi... 阅读全文
posted @ 2015-12-29 10:28 ICE_Inspire 阅读(272) 评论(0) 推荐(0)
摘要:EF:加入容器三种方式-->查询,attach,entry.不在容器里,不能用remove,add等方法.1.0 使用Attach可能会出错.//attach 意思:附上;贴上,系;var db = new PhoneBookEntities();var queryCi=db.ContactInfo... 阅读全文
posted @ 2015-11-28 01:59 ICE_Inspire 阅读(1842) 评论(0) 推荐(2)
摘要:对一个或者多个实体验证失败;关闭 实体属性合法性验证 阅读全文
posted @ 2015-11-24 23:28 ICE_Inspire 阅读(384) 评论(0) 推荐(0)
摘要:1.0 _ViewStart.cshtml _ViewStart.cshtml 里面的如果写了 <script src="/Scripts/jquery-1.8.2.js"></script> jquery会加载在html标签外面,可能导致jquery调用出问题.(学习瀑布里时,就是因为这个问题,查 阅读全文
posted @ 2015-11-22 20:16 ICE_Inspire 阅读(496) 评论(0) 推荐(0)
摘要:WebConfig配置 1 2 3 4 5 6 7 8 9 10 11 12 19 26 31 32 33 路由设置 1 ... 阅读全文
posted @ 2015-11-03 16:23 ICE_Inspire 阅读(625) 评论(0) 推荐(1)
摘要:1.0 初步建立目录和项目2.0 设置层之间的引用IRepository引用 ModelRepository引用 Model,IRepositoryIServices引用 Model,IRepositoryServices引用 Model,IRepository,IServicesSite引用 Mo... 阅读全文
posted @ 2015-11-02 20:17 ICE_Inspire 阅读(770) 评论(0) 推荐(1)
摘要:从客户端中检测到有潜在危险的 Request.Form 值 阅读全文
posted @ 2015-10-24 15:31 ICE_Inspire 阅读(295) 评论(0) 推荐(0)