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. iOS---初识Swift(一)

    一.Swift简介 ○ 2010年的夏天, 苹果公司的开发人员Chris Latten接到了一个特别的任务, 为OS X 和iOS平台开发下一代编程语言, 也就是Swift. ○ 苹果公司于2014年 ...

  2. android原生ExpandableListView

    android原生可扩展ExpandableListView就是可以伸缩的listView,一条标题下面有多条内容. 这个list的adapter对的数据要求与普通ListView的数据要求也有一些差 ...

  3. 用profile分析算法性能

    在命令行输入:profile viewer 会出现如下图所示探查器: 在运行此代码的后面的输入框中输入要运行的程序,然后点击启动探查,就会自动探查. 探查结束之后,会给出每个函数的调用次数.运行时间等 ...

  4. Spark源码学习1.5——BlockManager.scala

    一.BlockResult类 该类用来表示返回的匹配的block及其相关的参数.共有三个参数: data:Iterator [Any]. readMethod: DataReadMethod.Valu ...

  5. thinkPHP(待更新)

    一些函数 1.  set_include_path().get_include_path() .PATH_SEPARATOR 设置php加载的路径 2.  register_shutdown_func ...

  6. Disable the screen switching about VI

    If you want to disable the screen switching, and you don't want tochange your termcap, you can add t ...

  7. BZOJ 1597 土地购买

    斜率优化... #include<iostream> #include<cstdio> #include<cstring> #include<algorith ...

  8. unity文件解析以及版本控制

    刚开始使用unity做开发时,拿到一个范例工程先上传SVN,之后再自己做一些修改后,发现有非常多文件都有变化,这才知道有很多本地生成的文件,是不用上传的,但是不知道哪些才是需要共用的.之后又困扰于修改 ...

  9. 几个常见的布局的多种实现方式及margin负值总结

    第一部分:几个常见的布局实现方式 一.左右两边固定, center中间自适应未知 html代码中 center 部分首先要放在box的最前部分.然后是left,right 圣杯布局: <div ...

  10. c++ 泛型编程及模板学习

    泛型编程,英文叫做Generic programming 可以理解为,具有通用意义的.普适性的,编程. 比如,你要实现一个函数去比较两个数值的大小,数值可能是int或者string.初次尝试,我们直观 ...