This is a migrated thread and some comments may be shown as answers.

Button in RadAlert Template with Runat = Server

2 Answers 26 Views
Window
This is a migrated thread and some comments may be shown as answers.
Sergio
Top achievements
Rank 1
Sergio asked on 23 Jul 2015, 09:22 AM

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 Answers, 1 is accepted

Sort by
0
Accepted
Danail Vasilev
Telerik team
answered on 28 Jul 2015, 08:04 AM
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
0
Sergio
Top achievements
Rank 1
answered on 28 Jul 2015, 08:28 AM
Just as I thought. I will try what you have suggested. Thank you. 
Tags
Window
Asked by
Sergio
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Sergio
Top achievements
Rank 1
Share this question
or