How to inherit ContentTemplate of RadButton

2 posts, 0 answers
  1. Towhidul
    Towhidul avatar
    3 posts
    Member since:
    Apr 2012

    Posted 14 Jan 2015 Link to this post

    I have a RadButton like following:

        <telerik:RadButton ID="NewActionBtn" runat="server" NavigateUrl="New.aspx">
                <ContentTemplate>
                    <span class="myClass" style="color: black"></span>
                    <span class="myAnotherClass"> Add</span>
                </ContentTemplate>
         </telerik:RadButton>

    I want inherit this button so I only need to pass button text for the ContentTemplate. How will I do this. I don't want a WebUserControl with ascx extension.
  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 19 Jan 2015 Link to this post

    Hello Towhidul,

    The _contentTemplate field inside the RadButton that is used for the content template is not virtual, so that you cannot override it by inheriting the RadButton class.What I can suggest is that you either create a user control with the desired content template or you create a class that can instantiate it, as illustrated in the Button - Add elements in RadButton online demo.

    Regards,
    Danail Vasilev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top