+1-888-365-2779
Try Now
More in this section

Forums / Designing with Sitefinity / Do skins for image tags work in control templates?

Do skins for image tags work in control templates?

3 posts, 1 answered
  1. Ray
    Ray avatar
    15 posts
    Registered:
    09 Jul 2008
    05 Feb 2010
    Link to this post
    For the newsletter control I made a custom control template to style it. I set the control to use the template and everything seems to work except I can't get an image control i setup to work with the skin file for it. Is there an issue I don't know about where skins don't work inside a control template for certain controls or am I doing something wrong?

    Here my definition in the control template
    <asp:ImageButton ID="subscribeEMbtn" runat="server" CssClass="btn-submit" ValidationGroup="subscription" CausesValidation="true" ToolTip="Submit" SkinID="newsletter-btn" />


    And here is the definition in my skin file
    <asp:Image runat="server" ImageUrl="images/btn-submit.gif" SkinID="newsletter-btn" />

    I have other elements in the site setup the same way but they are in a usercontrol or in the master pages.
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    05 Feb 2010
    Link to this post
    Hello Ray,

    Thank you for using our services.

    Skins do apply to controls when controls are in control templates. On my side, I have this for the newsletter subscription form:
    <asp:ImageButton ID="subscribeEMbtn" runat="server" Text="Subscribe" SkinID="newsletter-btn" ValidationGroup="subscription" CausesValidation="true" />

    Then in the which my website uses I have added a skin file containing this:
    <asp:ImageButton runat=server ImageUrl="~/path to image" SkinID="newsletter-btn"/>

    And it works without a problem.

    Kind regards,
    Radoslav Georgiev
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
    Answered
  3. Ray
    Ray avatar
    15 posts
    Registered:
    09 Jul 2008
    05 Feb 2010
    Link to this post
    Ok,  I see where I made my mistake. My skin definition was for an Image control and not an ImageButton control. Not sure how I missed that, I feel silly now. Thanks for the help.
Register for webinar
3 posts, 1 answered