Billpeng Space

技术源自生活
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年9月24日

摘要: http://www.wyjexplorer.cn/Post/2012/8/1/invoking-jsonresult-and-return-error-message-in-aspnet-mvc-ajax一、如何用AJAX调用JsonResult方法 比如FuckController中添加有个返回JsonResult类型的方法FuckJson(): public JsonResult FuckJson(){return new JsonResult() {Data = new List<string>() { "fuck", "shit" 阅读全文

posted @ 2012-09-24 23:26 billpeng 阅读(3042) 评论(0) 推荐(1) 编辑

摘要: http://www.wyjexplorer.cn/Post/2012/8/3/model-validation-in-aspnet-mvc3ASP.NET MVC3中的Model是自验证的,这是通过.NET4的System.ComponentModel.DataAnnotations命名空间完成的。 我们要做的只是给Model类的各属性加上对应的验证标记(Attributes)就可以让MVC3框架帮我们完成验证。我以MVC3项目模板自带的登录 做例子讲解Model的验证。 一、启用客户端验证: 客户端验证主要是为了提高用户体验,在网页不回刷的情况下完成验证。 第一步是要在web.confi. 阅读全文

posted @ 2012-09-24 23:24 billpeng 阅读(40748) 评论(9) 推荐(18) 编辑

摘要: 我们的网页通常会有好几个部分组成,一些公共的区域我们通常会做成PartialView(部分视图),但这些视图并不是完全固定的,所以还是需要 特定的Controller来控制。如果只是静态的html,虽然也可以做成PartialView,但意义不大。下面演示一下MVC3中如何调用 PartialView。 首先我们创建一个测试用的Controller: TestController public class TestController : Controller{public ActionResult Message(){var testObj = new List<string>( 阅读全文

posted @ 2012-09-24 23:19 billpeng 阅读(24218) 评论(4) 推荐(3) 编辑

摘要: 1.MVC概念 --Model:用于存储数据的组件 --View:根据Model数据进行内容展示的组件 --Controller:接受并处理用户指令(操作Model),选择一个View并输出内容。 Controller对View进行引用,但是View不知道Controller的存在。Controller和View都是单向引用Model MVC变种:Observer模式,MVP模式。 2.mvc路由机制 MVC中重要的路由处理,默认情况是在Global.asax文件中,我们也可以把这块内容独立出来。 代码 1publicclassMyMvcAppliation:HttpApplication . 阅读全文

posted @ 2012-09-24 22:19 billpeng 阅读(1742) 评论(0) 推荐(1) 编辑

摘要: http://stackoverflow.com/questions/10715211/cannot-generate-ios-app-archive-in-xcode-4-3 阅读全文

posted @ 2012-09-24 14:04 billpeng 阅读(231) 评论(0) 推荐(0) 编辑