[CLOSED] Could you please tell me how to change the style top property for a ext:Label control using code behind?

  1. #1

    [CLOSED] Could you please tell me how to change the style top property for a ext:Label control using code behind?

    Hi,

    Could you please tell me how to change the style top property for a ext:Label control using code behind?

    Thanks,
    Last edited by geoffrey.mcgill; Aug 04, 2010 at 9:15 PM.
  2. #2
    Hi,

    You can set the .StyleSpec property.
    Geoffrey McGill
    Founder
  3. #3
    Flormariafr, please look at this sample code.

    <%@ Page Language="C#" %>
    
    <script runat="server">
        protected void Button_Click(object sender, DirectEventArgs e)
        {
            this.Label1.StyleSpec = "top:50px;position:absolute;";
        }    
    </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 runat="server">
        <ext:ResourceManager runat="server" />
        <ext:Label ID="Label1" runat="server" Text="Some text" />
        <ext:Button runat="server" Text="Change style">
            <DirectEvents>
                <Click OnEvent="Button_Click"/>
            </DirectEvents>
        </ext:Button>
        </form>
    </body>
    </html>
    P.S. I used this for demonstration purpose.
    position:absolute;
    Last edited by Daniil; Aug 04, 2010 at 2:07 PM.
  4. #4
    Hi Daniil,

    Thanks for the example it is very clear.

Similar Threads

  1. [CLOSED] How to add a style to a code behind generated control
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 9
    Last Post: Jun 12, 2012, 5:01 PM
  2. How to change ext label control css
    By kashif.qureshic10 in forum 1.x Help
    Replies: 0
    Last Post: Oct 12, 2011, 7:41 AM
  3. Replies: 2
    Last Post: Aug 10, 2010, 4:27 PM
  4. Replies: 4
    Last Post: Jun 25, 2010, 4:19 PM
  5. [CLOSED] Label Style / Obtain label color based on theme
    By rthiney in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Apr 15, 2010, 10:35 AM

Posting Permissions