Chapter 3: Develop the user experience
2024-08-25 21:29:22
Plan for search engine optimization and accessibility
- 使用analytical tools分析HTML,如SEO toolkit from MS, Webmaster Tools from Google, W3C Markup Validation Service
- 使用Browser插件观察结构,如IE的F12可打开developer Toolbar。
- WAI-ARIA for accessibility
Plan and implement globalization and localization
- planning a localization strategy
- 从HTTP头的Accept-Language取得browser的preferred language,但要设置<system.web>的<globalization culture="auto" uiculture="auto" enableclientbasedculture="true" />
- 使用resource到UI
- 使用resx file
- 在client端使用globalize.js
- client端主动设置culture
- 使用satellite assemblies,使用al.exe生成satellite dlls.
Design and implement MVC controllers and actions
- attributes和filters
- RequireHttpsAttribute
- ValidateAntiForgeryTokenAttribute
- ValidateInputAttribute
- AuthorizeAttribute
- ChildActionOnlyAction
- ActionFilterAttribute
- OnActionExecuting
- OnActionExecuted
- OnResultExecuting
- OnResultExecuted
- 使用attributes
- on the action iteslf
- on controller level
- through global filters,如filters.Add(new RequireHttpsAttribute());
- 实现action的行为
- 实现action的result
- ContentResult
- EmptyResult
- FileResult
- JavaScriptResult
- JsonResult
- PartialViewResult
- RedirectResult
- RedirectToRouteResult
- ViewResult
- 实现model binding
- DefaultModelBinder
- LinqBinaryModelBinder
- ModelBinderAttribute
- ModelBinderDictionary
weakly-typed style,如@Html.TextBox("login.UserName")
使用Bind attribute,
如public ActionResult Login([Bind(Prefix="login")]LoginUser user)
public ActionResult Save([Bind(Exclude="Salary")]Employee emp)
使用value provider取model
- FormsValueProvider
- QueryStringProvider
- HttpFileCollectionValueProvider
- RouteDataValueProvider
Design and implement routes
- 使用MapRoute定义一个route
- 使用route的限制,如 new {id=@"\d+"}
- ignore一个route
- Adding custom route parameters
- 使用area
Control application behavior by using MVC extensibility points
- 使用filter和controller factory
- Authorization
- Action
- Result
- Exception
- 通过action result控制,override ExecuteResult() of System.Web.Mvc.ActionResult
- 通过view engine
- 通过model binder
- 通过route handler
最新文章
- VS2010开发工具使用技巧<;之简单讲解>;
- .htaccess添加Header set Cache-Control报错500
- python走起之第五话
- 关于PF_RING/Intel 82599/透明VPN的一些事
- CSS 分组 和 嵌套 选择器
- Android:源码环境编译自定义的APP到ROM(System Image)中
- 页面加载完毕执行多个JS函数
- iOS 历史浏览网页的定向跳转
- TensorFlow源码安装
- Djanggo ORM操作
- DOM Access and Manipulation JS 操纵DOM
- JS获取开始、结束时间
- angularJS1笔记-(12)-自定义指令(compile/link)
- zabbix 触发器描述列表count
- C/C++——C语言库函数大全
- 九度oj题目1555:重复子串
- 【3】.net MVC 使用IPrincipal进行Form登录即权限验证
- Bootstrap-学习系列
- Oracle数据库不能创建表空间及表中文乱码问题
- [转]-webkit-overflow-scrolling:touch的应用
热门文章
- 【转】 Easy RadControl 之 RadGridView(Silverlight)
- 学习中的错误——ubuntu 14.04 LTS 启动eclipse报错
- JS 笔记(一)
- c/c++面试题(8)memcopy/memmove/atoi/itoa
- Which ports are considered unsafe on Chrome
- Fiddler-3 配置Fiddler监听iphone的http/https请求
- 一些Layout的坑。坑死我自己了
- iOS 上拉下拉刷新简单实现代码
- 从UWP到SWIFT-页面间反向传值
- WP8 MediaElement 实现循环播放