zoukankan      html  css  js  c++  java
  • 前台自动生成控件

    前台:

    <div id="location" runat="server">
    </div>

    后台:
        /// <summary> /// 自动生成button控件 /// </summary> public void GenerateControls() { StringBuilder strbHTMl = new StringBuilder(); strbHTMl.Append("<table>"); int count = 0; for (int i=0;i<100;i++) {//设置一行显示的控件个数 if (count == 0) { strbHTMl.Append("<tr>"); } if (count == 9) { strbHTMl.Append("</tr>"); count = 0; } strbHTMl.Append("<td>");    strbHTMl.Append("<input id="button" type="button" style="background:" + color + ";color:white;" value="" class="Button" >");
                 //strbHTMl.Append("<input   id="button" + garageNumber + "" type="button" style="background:" + color + ";color:white;" value="" + garageNumber + "" class="Button"    onclick=" window.showModalDialog('../LocationStatus.aspx/?Enter=" + garageNumber + "', '', 'dialogHeight=30;dialogWidth=60;dialogTop=30;dialogLeft=465;center=yes;resizable:no;scroll:no;status:no;help=no')" ">");
    //strbHTMl.Append("<input id="button" + garageNumber + "" type="button" style="background:" + color + ";color:white;" value="" + garageNumber + "" class="Button" onclick="window.open('../LocationStatus.aspx/?Enter=" + garageNumber + "', 'newwindow', 'height=450, width=900, top=300, left=490, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no')" ">"); strbHTMl.Append("</td>"); count++; } strbHTMl.Append("</table>"); location.InnerHtml = strbHTMl.ToString(); }
  • 相关阅读:
    Angular27 指令
    Angular26 ng-content和ng-container、投影的使用
    denied: requested access to the resource is denied
    kali 扫描之burp Suite学习笔记1
    VMware的包格式vmdk转换为virtualBox的ova
    面试之leetcode分治-求众数,x幂等
    C/c++语言开源项目总结
    面试之哈希表leetcode
    面试之leetcode20堆栈-字符串括号匹配,队列实现栈
    面试之leetcode链表
  • 原文地址:https://www.cnblogs.com/ingvner/p/7224549.html
Copyright © 2011-2022 走看看