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";      }

  • 相关阅读:
    LeetCode 461. Hamming Distance
    LeetCode 442. Find All Duplicates in an Array
    LeetCode 448. Find All Numbers Disappeared in an Array
    LeetCode Find the Difference
    LeetCode 415. Add Strings
    LeetCode 445. Add Two Numbers II
    LeetCode 438. Find All Anagrams in a String
    LeetCode 463. Island Perimeter
    LeetCode 362. Design Hit Counter
    LeetCode 359. Logger Rate Limiter
  • 原文地址:https://www.cnblogs.com/wujy/p/2348714.html
Copyright © 2011-2022 走看看