Apply the user interface design for a web application

介绍了Css的常用属性和html5的新element,以及Htmlhelper的简单方法,如BeginForm, TextBox, TextArea。

Design and implement UI behavior

  • client validation:

在Model中使用attribute binding to property,在View中使用EditorFor/ValidationMessageFor实现client validation。

Server side再通过ModelState.IsValid来check。

  • remote validation

通过Remote("Action", "Controller")属性binding to property,

如下web.config中key的value需为true。

<appSettings>

<add key="ClientValidationEnabled" value="true" />

<add key="UnobtrusiveJavaScriptEnabled" value="true" />

</appSettings>

  • 使用AJAX更新部分page
  • 使用jQuery实现UI

Compose the UI layout of an application

  1. 用partial view实现公共部分,@Html.Partial("partialPage")
  2. 使用Razor的templates实现如EditorFor这类功能,~/Views/ControllerName(Shared)/EditorTemplates/Templatename.cshtml, ~/Views/ControllerName(Shared)/DisplayTemplates/Templatename.cshtml
  3. 使用Master page,Layout可变,if(ViewBag.switch=="layout1") Layout = “~/Views/Shared/_plainLayout.cshtml"; else Layout = "~/Views/Shared/_Layout.cshtml";

Enhance application behavior and style based on browser feature detection

  • 使用userAgent header的信息判断browser的名字,如IE
  • 通过DisplayModeProvider.Instance.Modes.Insert(0, new DefaultDisplayMode("")...),支持不同的display mode。

Plan an adaptive UI layout

  • 使用<meta> tag和CSS的@media查询指定layout
  • 使用jQuery.Mobile.MVC

Chapter 2: Design the user experience的更多相关文章

  1. Chapter 5: Design and implement security

    Configure authentication Authenticating users IIS authentication Anonymous ASP.net impersonation Bas ...

  2. Chapter 3: Develop the user experience

    Plan for search engine optimization and accessibility 使用analytical tools分析HTML,如SEO toolkit from MS, ...

  3. Chapter 1: Design the application architecture

    1.1 Plan the application layers 提到了repository pattern,SoC(Separation of Concern), 进而提及MVC,Action/Act ...

  4. Chapter 7. Design and Performance

    本章将对MPEG4及H.264的实现细节进行讲解和比对. Motion Estimation 衡量运动估计的好坏有三种函数(第228页):MSE,MAE和SAE,其中由于SAE运算速度最快所以采用的最 ...

  5. MapReduce Design Patterns(chapter 1)(一)

    Chapter 1.Design Patterns and MapReduce MapReduce 是一种运行于成百上千台机器上的处理数据的框架,目前被google,Hadoop等多家公司或社区广泛使 ...

  6. (转)MapReduce Design Patterns(chapter 1)(一)

    翻译的是这本书: Chapter 1.Design Patterns and MapReduce MapReduce 是一种运行于成百上千台机器上的处理数据的框架,目前被google,Hadoop等多 ...

  7. Chapter 6 — Improving ASP.NET Performance

    https://msdn.microsoft.com/en-us/library/ff647787.aspx Retired Content This content is outdated and ...

  8. Lesson 1: What is design? Why is it important?

    Week 2: What is design? Why is it important? Article 1: Startups, this is how design works. It's a s ...

  9. MVVM与Backbone demo

    MVVM https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel

随机推荐

  1. jquery如何根据text选择option

    百度出来的代码都是这样的: $('#test option[text="b"]').attr("selected",true); 或 $('#test').fi ...

  2. Git忽略规则及.gitignore规则不生效的解决办法

    在git中如果想忽略掉某个文件,不让这个文件提交到版本库中,可以使用修改根目录中 .gitignore 文件的方法(如无,则需自己手工建立此文件).这个文件每一行保存了一个匹配的规则例如: # 此为注 ...

  3. JSTL(1.1)的配置

    1.查看你的项目中web.xml实际配置的servlet版本号? 2. servlet2.4所需要的jstl版本是1.1,所以上网下载jstl(1.1)的2个jar包,然后把这个2个jar包拷贝到你自 ...

  4. 软件测试第四周--关于int.parse()的类型转换问题

    先来归纳一下我们用过的所有类型转换方法: 1. 隐式类型转换,即使用(int) 直接进行强制类型转换.这种方法的优点是简单粗暴,直接指定转换类型,没有任何保护措施,所以也很容易抛出异常导致程序崩溃.当 ...

  5. BackgroundWorker组件的作用

    当构建一个图形化的Windows Form桌面应用程序并且需要执行在应用程序主UI线程之外的线程中长时间的任务时,BackgroundWorker类就很有用了. 要使用BackgroundWorker ...

  6. SQL Server 简介

    什么是数据库? 数据库(Database)是按照数据结构来组织.存储和管理数据的仓库.是以一定方式储存在一起.能为多个用户共享.具有尽可能小的冗余度的特点.是与应用程序彼此独立的数据集合. SQL S ...

  7. 【转】Thread.isBackground

    C#中,Thread类有一个IsBackground 的属性.MSDN上对它的解释是:获取或设置一个值,该值指示某个线程是否为后台线程.个人感觉这样的解释等于没有解释. .Net中的线程,可以分为后台 ...

  8. js 控制框架页面跳转 top.location.herf = "url"

    top.location.href和localtion.href有什么不同 top.location.href=”url”          在顶层页面打开url(跳出框架) self.locatio ...

  9. ubuntu10.04.4下安装JDK

    第一步:http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html下载安装包(本来是可以通过 ...

  10. apache安全配置---禁止访问特定文件,防止日志、压缩包被下载

    指定禁止访问 某些后缀的文件 修改apache配置httpd.conf,在最后加上配置后,重启apache <Files ~ ".txt|.log|.zip|.gz|.sql" ...