zoukankan      html  css  js  c++  java
  • Chapter 2: Design the user experience

    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
    --------------------------- 知道的更多,不知道的也更多 ---------------------------
  • 相关阅读:
    HRBUST 1377 金明的预算方案
    51Nod 2649 完全背包
    计蒜客 T2129 采药
    计蒜客 T1408 矩形嵌套
    OpenJudge 2711 合唱队形
    51Nod 2080 最长上升子序列
    2021NUAA暑假集训 Day5 部分题解
    2021NUAA暑假集训 Day4 部分题解
    C++ 11 move constructor 何时调用?
    老外这样说英文
  • 原文地址:https://www.cnblogs.com/mryux/p/4737703.html
Copyright © 2011-2022 走看看