Page view counter

ToggleButtonExtender - Skinning

Last post 06-27-2007 5:45 PM by RTernier. 5 replies.

Sort Posts:

  • ToggleButtonExtender - Skinning

    06-27-2007, 1:32 PM
    • Loading...
    • RTernier
    • Joined on 06-04-2003, 9:40 PM
    • British Columbia, Canada
    • Posts 1,063
    • Points 4,490

    Is it possible to skin the ToggleButtonExtender instead of providing a CheckedImageUrl/UnCheckedImageUrl?

    We do not deal with any direct Images/Themes/Skins in our applications. All our images/themes/skins etc. are in the IIS Global location. This allows our 15 or so WAP's in our main solution to all read from the same theme's directory.

    The Killer Ninja Coding Monkeys thank those that mark helpful posts as answers.

    My Site | My Examples | My Blog


  • Re: ToggleButtonExtender - Skinning

    06-27-2007, 2:29 PM
    • Loading...
    • kirtid
    • Joined on 11-18-2006, 12:41 AM
    • Redmond
    • Posts 658
    • Points 2,610

    The Toolkit supports skinning. If you look under the App_Themes folder in SampleWebSite you will see that we have used skins for CollapsiblePanel and ToolkitScriptManager. I am not sure how you are sharing the themes across web applications but if it is possible then the same principle applies to the TOolkit controls as well.

    Kirti Deshpande
    Program Manager, Silverlight and ASP.NET AJAX
    Microsoft

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: ToggleButtonExtender - Skinning

    06-27-2007, 2:38 PM
    • Loading...
    • RTernier
    • Joined on 06-04-2003, 9:40 PM
    • British Columbia, Canada
    • Posts 1,063
    • Points 4,490

    Themes work great with the global skinning - however on the ToggleBUtotnExtender I get the error that UncheckedImageUrl needs to be in there.  It should hit the skin, but it's not for some reason.

     Here's my Skin declaration:

    <ajaxToolkit:ToggleButtonExtender runat="server" SkinID="TogFlag" UncheckedImageUrl="Images/pin_green.png" CheckedImageUrl="pin_red.png" />


    and here's my control on the ASPX page:

                    <asp:CheckBox ID="chkFlag" runat="server" Text="[Flag]" />
                    <ajaxToolkit:ToggleButtonExtender ID="togFlag" runat="server" TargetControlID="chkFlag" SkinID="TogFlag" />

    Edit:

     The error I get is:

    AjaxControlToolkit.ToggleButtonExtender missing required UncheckedImageUrl property value for togFlag.
    Parameter name: UncheckedImageUrl


     

    The Killer Ninja Coding Monkeys thank those that mark helpful posts as answers.

    My Site | My Examples | My Blog


  • Re: ToggleButtonExtender - Skinning

    06-27-2007, 3:02 PM
    Answer
    • Loading...
    • kirtid
    • Joined on 11-18-2006, 12:41 AM
    • Redmond
    • Posts 658
    • Points 2,610

    Here is what I tried and it worked for me.

    THis is the skin file:  

    <%--
    Default skin template. The following skins are provided as examples only.
    
    1. Named control skin. The SkinId should be uniquely defined because
       duplicate SkinId's per control type are not allowed in the same theme.
    
    <asp:GridView runat="server" SkinId="gridviewSkin" BackColor="White" >
       <AlternatingRowStyle BackColor="Blue" />
    </asp:GridView>
    
    2. Default skin. The SkinId is not defined. Only one default 
       control skin per control type is allowed in the same theme.
    
    <asp:Image runat="server" ImageUrl="~/images/image1.jpg" />
    --%>
    
    <%@ Register
        Assembly="AjaxControlToolkit"
        Namespace="AjaxControlToolkit"
        TagPrefix="ajaxToolkit" %>
        
    <ajaxToolkit:ToggleButtonExtender runat="Server" 
            ImageWidth="19"
            ImageHeight="19"
            UncheckedImageUrl="~/images/ToggleButton_Unchecked.gif"
            CheckedImageUrl="~/images/ToggleButton_Checked.gif"
            CheckedImageAlternateText="Check"
            UncheckedImageAlternateText="UnCheck" />
     

    And this is the sample website demo page extender declaration:

     

    <asp:CheckBox ID="CheckBox1" Checked="true" Text="I like ASP.NET" runat="server"/><br />
    <ajaxToolkit:ToggleButtonExtender ID="ToggleButtonExtender1" runat="server"
    TargetControlID="CheckBox1" />
            
    <asp:CheckBox ID="CheckBox2" Checked="true" Text='I like ASP.NET AJAX' runat="server"/><br /><br />
    <ajaxToolkit:ToggleButtonExtender ID="ToggleButtonExtender2" runat="server"
    TargetControlID="CheckBox2" />
    
     
    Kirti Deshpande
    Program Manager, Silverlight and ASP.NET AJAX
    Microsoft

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: ToggleButtonExtender - Skinning

    06-27-2007, 3:05 PM
    • Loading...
    • RTernier
    • Joined on 06-04-2003, 9:40 PM
    • British Columbia, Canada
    • Posts 1,063
    • Points 4,490

    AHhh, I never registered the tag - that might be the problem.. I'll try that.


    Thanks.

    ===Edit

    Even with that it still doesn't work. I'll try playing around a bit. I'll get it working with the default theme in the project, and then get it working with the global themes :\ 

    The Killer Ninja Coding Monkeys thank those that mark helpful posts as answers.

    My Site | My Examples | My Blog


  • Re: ToggleButtonExtender - Skinning

    06-27-2007, 5:45 PM
    • Loading...
    • RTernier
    • Joined on 06-04-2003, 9:40 PM
    • British Columbia, Canada
    • Posts 1,063
    • Points 4,490

     The Skinning works when the WAP has the theme actually hosted via the project. However,once I switch to global themes it's not working.

     I believe I have to restart IIS / reset the global... they might be cached.

    I forget the aspnet_regiis command for that, so I think i'll try to manually do it.

     

    Thanks for the help, your one post did solve my answer. 

    The Killer Ninja Coding Monkeys thank those that mark helpful posts as answers.

    My Site | My Examples | My Blog


Page 1 of 1 (6 items)