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. JSTL标签库的使用

    首先是四大标签库 核心 标签库 <%@ taglib uri="http://java.sun.com/jsp/jstl/core"%> 格式标签库 <%@ ta ...

  2. java中开源日志记录工具log4j

    日志:除了能记录异常信息,还可以记录程序正常运行时的关键信息. 使用log4j来进行日志文件记录经典步骤: 001.在项目中创建一个lib文件夹,然后将下载好的jar包copy到该文件夹下 002.对 ...

  3. MVC 请求处理流程(二)

    [上一篇]中我们说到了对象AsyncControllerActionInvoker,在Controller的ExecuteCore方法中调用AsyncControllerActionInvoker对象 ...

  4. C 计算数组长度

    int data[4],length; length=sizeof(data)/sizeof(data[0]);  //数组占内存总空间除以单个元素占内存空间大小,即等于元素个数 printf(&qu ...

  5. [Python]命令行进度条

    关键点是输出'\r'这个字符可以使光标回到一行的开头,这时输出其它内容就会将原内容覆盖. import time import sys def progress_test(): bar_length= ...

  6. JPA 各种基本用法

    查询部分属性 通常来说,都是针对 Entity 类的查询,返回的也是被查询的 Entity 类的实体.J P QL 也允许我们直接查询返回我们需要的属性,而不是返回整个 Entity .在一些 Ent ...

  7. 理解python的with语句

    Python’s with statement provides a very convenient way of dealing with the situation where you have ...

  8. Android系统启动过程

    首先Android框架架构图: Linux内核启动之后就到Android Init进程,进而启动Android相关的服务和应用. 启动的过程如下图所示:(图片来自网上,后面有地址)   下面将从And ...

  9. c++构造函数 对象初始化

    最近查看了关于c++构造函数的博客,为了防止关键知识的遗忘,特此记录一些要点,以便于今后的查阅. 如果不主动书写构造函数,c++或默认提供一般构造函数,拷贝构造函数以及复制运算符的操作.一般的构造函数 ...

  10. devenv命令详解

    devenv  [解决方案文件 | 项目文件 | 任意文件.扩展名]  [开关] devenv 的第一个参数通常是一个解决方案文件或项目文件. 如果您希望在编辑器中自动打开文件, 也可以使用任何其他文 ...