zoukankan      html  css  js  c++  java
  • 在mvc里面有htmlhelper方法,在webform里面有什么?

    终于是找到原来在webform里面已经提供了htmlcontrol这样的控件,可以直接拿来用。以前一直在想mvc有htmlhelper,webform里面不能用,其实是webform里面已经有了。

    例子

    HtmlGenericControl htmlgeneric = new HtmlGenericControl("div");
    htmlgeneric.Attributes.Add("data-dojo-type", "dijit/Toolbar");
    htmlgeneric.ClientIDMode = ClientIDMode.Static;//.net 4下面才有此属性,2的话就没有了。
    htmlgeneric.ID = "toolbar1";

    HtmlGenericControl btna = new HtmlGenericControl("div");
    btna.Attributes.Add("data-dojo-type", "dijit/form/Button");
    btna.Attributes.Add("data-dojo-props", "iconClass:'dijitIconDelete', showLabel:false,onClick:function(){ return Delete();}");
    btna.ClientIDMode = ClientIDMode.Static;
    btna.ID = "toolbar1.clear";

    HtmlGenericControl griddiv = new HtmlGenericControl("div");
    griddiv.ClientIDMode = ClientIDMode.Static;
    griddiv.ID = "gridDiv";


    htmlgeneric.Controls.Add(btna);

    this.Controls.Add(htmlgeneric);
    this.Controls.Add(griddiv);

  • 相关阅读:
    Oracle ASH报告生成和性能分析
    Oracle AWR报告生成和性能分析
    oracle和mysql批量合并对比
    Oracle
    Delphi
    Delphi
    Delphi
    Delphi
    Delphi
    Delphi
  • 原文地址:https://www.cnblogs.com/forhell/p/4781933.html
Copyright © 2011-2022 走看看