Button in RadAlert Template with Runat = Server

3 posts, 1 answers
  1. Sergio
    Sergio avatar
    2 posts
    Member since:
    Mar 2012

    Posted 23 Jul 2015 Link to this post

    Hello,

     

    I have the following problem. I have a RadAlert with a custom  template. This radalert is called serverside and I want to add a button that when pressed calls a method serverside. For example:

     

    <%@  control language="C#" classname="AlertTemplate" %>
    <div class="rwDialogPopup radalert">
        <div class="rwDialogText">
            {1}
        </div>

    <div>

    </br>

    <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />

    OR 

    <telerik:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click"/>

    </br>
        <div>
            <a onclick="$find('{0}').close();" class="rwPopupButton" href="javascript:void(0);">
                <span class="rwOuterSpan"><span class="rwInnerSpan">##LOC[OK]##</span> </span>
            </a>
        </div>
    </div>

     

     

    Is this possible at all? 

     

    Thanks in advance.

  2. Answer
    Danail Vasilev
    Admin
    Danail Vasilev avatar
    1492 posts

    Posted 28 Jul 2015 Link to this post

    Hello Sergio,

    You cannot place server-side controls inside alert/prompt/confirm templates but only HTML. What I can suggest is that you try the following:
        - Use a pure RadWindow control with Modality and ContentTemplate where you can place the desired content. You can also open the RadWindow from the server-side, as illustrated in this article - http://docs.telerik.com/devtools/aspnet-ajax/controls/window/troubleshooting/opening-from-the-server
         - Use simple HTML buttons/inputs inside the template. You can perform a __doPostBack() from the onclick event of each button where you can execute your logic on the server-side.


    Regards,
    Danail Vasilev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sergio
    Sergio avatar
    2 posts
    Member since:
    Mar 2012

    Posted 28 Jul 2015 in reply to Danail Vasilev Link to this post

    Just as I thought. I will try what you have suggested. Thank you. 
Back to Top