2013年3月5日

client validation

摘要: 首先要引用validation.js[Required(ErrorMessage = "An Album Title is required")][StringLength(160)]public string Title { get; set; }[Required(ErrorMessage = ... 阅读全文

posted @ 2013-03-05 15:13 fishyk 阅读(141) 评论(0) 推荐(0) 编辑

2013年3月4日

MVC AJAX

摘要: Use: @Ajax.ActionLink("Click here to see today's special!", "DailyDeal", new AjaxOptions{ UpdateTargetId = "dailydeal", InsertionMode... 阅读全文

posted @ 2013-03-04 18:03 fishyk 阅读(114) 评论(0) 推荐(0) 编辑

2013年2月22日

HttpReferrer Validation

摘要: public class IsPostedFromThisSiteAttribute : AuthorizeAttribute{ public override void OnAuthorize(AuthorizationContext filterContext) { if (filterContext.HttpContext != null) { if (filterContext.HttpContext.Request.UrlReferrer == null) throw new System.Web.HttpException(“Invalid ... 阅读全文

posted @ 2013-02-22 17:06 fishyk 阅读(150) 评论(0) 推荐(0) 编辑

2013年2月20日

Trigger

摘要: DML触发器:是当数据库发生数据语言操作事件时会自动执行的存储过程。(DELETE,UPDATE,INSERT)(1)AFTER触发器:这类触发器是在记录已经改变完之后,才会被激活的,主要是记录变更之后的处理或检查,一旦发现错误也可以用rollback transaction返回操作(2)INSTE... 阅读全文

posted @ 2013-02-20 00:54 fishyk 阅读(161) 评论(0) 推荐(0) 编辑

2013年2月19日

Self Validation

摘要: public class Others : IValidatableObject { public IEnumerable Validate(ValidationContext validationContext) { if (Name !=... 阅读全文

posted @ 2013-02-19 17:58 fishyk 阅读(187) 评论(0) 推荐(0) 编辑

ValidationAttribute

摘要: public class MaxWordsAttribute : ValidationAttribute { public MaxWordsAttribute() : base(() => { return "{0} has too many words.... 阅读全文

posted @ 2013-02-19 17:39 fishyk 阅读(162) 评论(0) 推荐(0) 编辑

Func<>

摘要: class Program { static void Main(string[] args) { Tee(() => { return "aaa"; }); Console.Read(); } static string ter() { return "aa"; } static void Tee(Func fs) { string ss = fs(); } ... 阅读全文

posted @ 2013-02-19 16:34 fishyk 阅读(208) 评论(0) 推荐(0) 编辑

2013年2月4日

序列化 和 反序列化

摘要: 序列化又称串行化,是.NET运行时环境用来支持用户定义类型的流化的机制。其目的是以某种存储形成使自定义对象持久化,或者将这种对象从一个地方传输到另一个地方。 .NET框架提供了两种串行化的方式:1、是使用BinaryFormatter进行串行化;2、使用SoapFormatter进行串行化;3... 阅读全文

posted @ 2013-02-04 23:50 fishyk 阅读(157) 评论(0) 推荐(0) 编辑

2013年2月3日

LocationManager操作

摘要: LocationManager mLocationManager; Location mLocation; mLocationManager = (LocationManager)this.getSystemService(Context.LOCATIO... 阅读全文

posted @ 2013-02-03 22:05 fishyk 阅读(163) 评论(0) 推荐(0) 编辑

访问URL

摘要: URL url; try { url = new URL(address); HttpURLConnection con = (HttpURLConnection)url.openConnection(); ... 阅读全文

posted @ 2013-02-03 22:02 fishyk 阅读(152) 评论(0) 推荐(0) 编辑

导航