随笔分类 -  Asp.Net Mvc

摘要:一、首先了解下子类继承父类构造函数调用的问题● 通过子类无参构造函数创建子类实例,会默认调用父类的无参构造函数● 通过子类有参构造函数创建子类实例,也会默认调用父类的无参构造函数● 在子类构造函数中通过base关键字指明父类构造函数,当通过子类构造函数创建实例,会调用... 阅读全文
posted @ 2018-06-27 09:42 HPUGIS 阅读(397) 评论(0) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace HOPU.IDAL{ ... 阅读全文
posted @ 2018-06-09 11:47 HPUGIS 阅读(263) 评论(0) 推荐(0)
摘要:using Memcached.ClientLibrary;using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading... 阅读全文
posted @ 2018-06-08 10:05 HPUGIS 阅读(171) 评论(0) 推荐(0)
摘要:一、后台代码封装using System;using System.Collections.Generic;using System.Drawing;using System.Drawing.Drawing2D;using System.Drawing.Imaging... 阅读全文
posted @ 2018-06-08 09:44 HPUGIS 阅读(182) 评论(0) 推荐(0)
摘要:在这里我们用到的是 HttpFileCollection类HTML中代码: 后台Home控制器中Save方法代码: public ActionResult Save() { ... 阅读全文
posted @ 2018-05-07 10:19 HPUGIS 阅读(2707) 评论(0) 推荐(0)
摘要:可以声明一个自定义控制器BaseController继承Controller重写Controller中的OnActionExecuting虚方法,然后其他控制器继承BaseController就可以,避免了给每个控制器打个过滤标签去验证public class Bas... 阅读全文
posted @ 2018-05-07 09:14 HPUGIS 阅读(879) 评论(0) 推荐(0)
摘要:一、AuthorizeAttribute{ /// /// 允许 /// public class HasPermissionAttribute : AuthorizeAttribute //Authorize授权特性 { ... 阅读全文
posted @ 2018-05-07 09:12 HPUGIS 阅读(546) 评论(0) 推荐(0)
摘要:使用MVC和EF,在保存数据的时候报错:System.Data.Entity.Validation.DbEntityValidationException: 对一个或多个实体的验证失败。有关详细信息,请参阅“EntityValidationErrors”属性。 原文地址:https://www.cn 阅读全文
posted @ 2018-05-05 10:16 HPUGIS 阅读(1038) 评论(0) 推荐(0)
摘要:IHttpModule向实现类提供模块初始化和处置事件。 IHttpModule包含两个方法: public void Init(HttpApplication context);public void Dispose();Init():这个方法接受一个HttpApplication对象,HttpA 阅读全文
posted @ 2018-04-12 21:49 HPUGIS 阅读(124) 评论(0) 推荐(0)