zoukankan      html  css  js  c++  java
  • MVC 2.0 开发备忘

    一、 不经后台直接打开控件
     
    1.<%  Html.RenderPartial("TreeControl", Model.Groups);%>  //在同一个Controller下

    2.<% Html.RenderPartial("~/Views/HR/SelfAbilityIndex.ascx", model%>//在另一个Controller下


    二、 按钮(链接)

    1 <%=Ajax.ActionLink("编辑", // 显示名
       "UpdateSelfAbility", // 后台Action
       new { abilityGuid = item.PubGuid }, // action 参数
       new AjaxOptions { //Ajax 选项
         UpdateTargetId = "dynamicPanel", //数据显示的容器
         HttpMethod = "get",// 数据模式 get post
         InsertionMode = InsertionMode.Replace }//更新方式 替换,插入等
      )%>

    三、 数据绑定

    1.  <%: Html.TextBoxFor(model => model.AbilityDesc, new { Style = "20px;height:30px;" })%> 
         // 为 AbilityDesc 属性建立一个TextBox 控件 后面是控件的样式 再回送的FormCollection 里可以通过 form["AbilityDesc"]  找到

    四、C# 使用 

      1. string 的 split(",") 按 ,切开字符串

      2 可在classDiagram写注释

      3 static class 不能参与继承

      4  反射  using System.Reflection; 

                    PropertyInfo[] infos = typeof(T).GetProperties();
                    PropertyInfo  a = infos[1];

     
    五、界面元素赋值

      1. 可以通过<input id ="<%= item,Title %>"/>的方法赋id值其他类似

     
    六、其他   1. Action 的参数名不能是 “id”  
       2. Action 去除缓存 [OutputCache( VaryByParam = "none")]
         

  • 相关阅读:
    6、方法
    5、封装
    4、循环
    3、判断
    2、基本语法
    1、基本框架
    CodeForces 681C Heap Operations(模拟)
    CodeForces 682C Alyona and the Tree(广搜 + 技巧)
    URAL 2099 Space Invader题解 (计算几何)
    HDU 5833 (2016大学生网络预选赛) Zhu and 772002(高斯消元求齐次方程的秩)
  • 原文地址:https://www.cnblogs.com/GhostZCH/p/2125613.html
Copyright © 2011-2022 走看看