Decorating text inside <SPAN> tags

2 posts, 0 answers
  1. mqsash
    mqsash avatar
    31 posts
    Member since:
    May 2012

    Posted 03 Sep 2013 Link to this post

    Hi,

    I've got a form decorator in which I have set the DecoratedControls = FormDecoratorDecoratedControls.All

    With this done, I was thinking that all text on my page would get decorated with the fonts and styles based on the selected skin. But it seems like while all <Label> and input and other controls do get decorated, any text inside of <SPAN> tags does not.

    I confirmed using the developer tools that there were no rad css styles applied to the text at all.

    So the questions I have are
    1. Is text inside SPAN tags not decorated by the RadFormDecorator?
    2. What options do I have to make that text pickup the same fonts as the regular <Label> tags and other decorated controls on the page.?
        Do I need to convert all texts inside SPAN tags to <Label> ?

    Thanks
    mqs
  2. Bozhidar
    Admin
    Bozhidar avatar
    677 posts

    Posted 04 Sep 2013 Link to this post

    Hello,

    Thanks for contacting us. RadFormDecorator is decorating form elements but not all the HTML elements in the document.

    If you want your spans to have a decorated text, you have to apply them a CSS class: rfdAspLabel. Bellow is a simple sample of the different optsions:

    <body>
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadSkinManager runat="server" ShowChooser="true">
        </telerik:RadSkinManager>
        <telerik:RadFormDecorator runat="server" DecoratedControls="All" />
     
        <label>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer gravida mi ultrices quam mollis, ut porta mauris mollis. Etiam condimentum rhoncus nisi, eget facilisis tellus malesuada sit amet. Etiam vel felis tortor. </label>
     
        <br /><br />
     
        <span>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer gravida mi ultrices quam mollis, ut porta mauris mollis. Etiam condimentum rhoncus nisi, eget facilisis tellus malesuada sit amet. Etiam vel felis tortor. </span>
     
        <br /><br />
     
        <span class="rfdAspLabel">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer gravida mi ultrices quam mollis, ut porta mauris mollis. Etiam condimentum rhoncus nisi, eget facilisis tellus malesuada sit amet. Etiam vel felis tortor. </span>
     
        </form>
    </body>


    Regards,
    Bozhidar
    Telerik
    Explore the entire set of ASP.NET AJAX controls we offer here and browse the myriad online demos to learn more about the components and the features they incorporate.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top