Icon button and user controls

  1. #1

    Icon button and user controls

    hi,
    now i want to testing the coolite Ext.Net 1.0, i create my user control and i call this with LoadControl.
    in this usercontrol are just a button:

    
    <ext:Button ID="butAdd" runat="server" Icon="Add" Text="Add"></ext:Button>
    the icon in this but icon
    button is not show

    any solution ?

    regard's
  2. #2

    RE: Icon button and user controls

    Hi maxdiable,

    You might have to call .RegisterIcon on the <ext:ResourceManager> at the same time the Button is created/loaded.


    Example


    this.ResourceManager1.RegisterIcon(Icon.Accept);

    I'm hoping to have a feature in place soon that will automatically handle the Icon registration.


    Geoffrey McGill
    Founder
  3. #3

    RE: Icon button and user controls

    I just happen to have a full example available that demonstrates using .RegisterIcon.

    Example

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Button1_Click(object sender, DirectEventArgs e)
        {
            new Ext.Net.Panel
            {
                ID = "Panel2",
                Title = "Inner",
                Padding = 5,
                Html = "Example",
                Icon = Icon.Accept,
                Border = false
            }.AddTo(this.Panel1);
    
            this.ResourceManager1.RegisterIcon(Icon.Accept);
        }
    </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 runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
            
            <ext:Button ID="Button1" runat="server" Text="Submit" OnDirectClick="Button1_Click" />
            
            <ext:Panel ID="Panel1" runat="server" Title="Example" Height="185" Width="350" Layout="fit" />
        </form>
    </body>
    </html>
    Hope this helps.

    Geoffrey McGill
    Founder
  4. #4

    RE: Icon button and user controls

    nice :) tank's

Similar Threads

  1. [CLOSED] panel icon missing when dynamically load a user control
    By CarpFisher in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Jul 30, 2012, 7:47 AM
  2. Replies: 1
    Last Post: Jul 20, 2012, 8:08 AM
  3. [CLOSED] How should I nested ext.net.controls with user controls?
    By ViDom in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 04, 2012, 11:14 AM
  4. Replies: 5
    Last Post: Nov 03, 2011, 2:39 AM
  5. Icon registration and user controls
    By reverseblade in forum 1.x Help
    Replies: 3
    Last Post: May 08, 2010, 8:24 PM

Posting Permissions