zoukankan      html  css  js  c++  java
  • Ext.net 动态生成控件

    <%@ Page Language="C#" %>

    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <%@ Register Assembly="Ext.Net.UX" Namespace="Ext.Net.UX" TagPrefix="ux" %>
    <script runat="server">   
        Ext.Net.Button b;
        Ext.Net.TextField c;
        protected override void OnInit(EventArgs e) {
            b = new Ext.Net.Button("Get .Text");
            b.DirectEvents.Click.Event += AddClick;
            this.Form.Controls.Add(b);
            c = new Ext.Net.TextField();
            this.Form.Controls.Add(c);
            }    
        protected void btnClick(object sender, DirectEventArgs e)
        { c.Text = "123"; }     
        protected virtual void AddClick(object sender, EventArgs e)
        { X.Msg.Alert("value", c.Text).Show(); }
        </script>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form id="Form1" runat="server">
        <ext:ResourceManager runat="server" />
        <ext:Button runat="server" Text="Set .Text" OnDirectClick="btnClick" />
        </form>
    </body>
    </html>

    protected override void OnInit(EventArgs e) {         b = new Ext.Net.Button("Click Me");         b.ID = "myID";         b.DirectEvents.Click.Event += new ComponentDirectEvent.DirectEventHandler(AddClick);         this.Form.Controls.Add(b);            c = new Ext.Net.TextField();         c.ID = "edt1";         this.Form.Controls.Add(b);       }        protected void btnClick(object sender, DirectEventArgs e)     {         c.Text="123";      }

  • 相关阅读:
    jQuery操作CheckBox的方法(选中,取消,取值)详解
    checkAll操作
    java 去掉重复的数字
    multiselect多选下拉框
    toggle() 隐藏和收缩
    Test 6.29 T4 简单数据结构练习
    Test 6.29 T3 小学生
    Test 6.29 T2 染色
    Test 6.29 T1 预算方案
    [洛谷P3338] ZJOI2014 力
  • 原文地址:https://www.cnblogs.com/wujy/p/2348714.html
Copyright © 2011-2022 走看看