Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q1 2012 released 04/11/2012
select

Window / Alert, Prompt, Confirm

Browser GUI: Alert, Prompt, Confirm


Manipulate radalert and radconfirm content image:




 

Dialogs called from client:






 

Dialogs called from server:








  • New: The radalert and radconfirm allow to easily control the content image by passing an optional argument at the end of the method call. The argument contains relative or absolute url and if empty string is provided - the image is removed.

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>

    <%@ Page AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="Telerik.Web.Examples.Window.BrowserDialogBoxes.DefaultCS"
        Language="c#" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <qsf:HeadTag runat="server" ID="Headtag1"></qsf:HeadTag>
        <!-- custom head section -->
        <!-- end of custom head section -->
        <script type="text/javascript">
                            //<![CDATA[
            var imgUrl = null;
            function alertCallBackFn(arg) {
                radalert("<strong>radalert</strong> returned the following result: <h3 style='color: #ff0000;'>" + arg + "</h3>", null, null, "Result");
            }

            function confirmCallBackFn(arg) {
                radalert("<strong>radconfirm</strong> returned the following result: <h3 style='color: #ff0000;'>" + arg + "</h3>", null, null, "Result");
            }

            function promptCallBackFn(arg) {
                radalert("After 7.5 million years, <strong>Deep Thought</strong> answers:<h3 style='color: #ff0000;'>" + arg + "</h3>", null, null, "Deep Thought");
            }

            function pageLoad() {
                //attach a handler to readion buttons to update global variable holding image url
                var $ = $telerik.$;
                $('input:radio').bind('click', function () {
                    imgUrl = $(this).val();
                });
            }

                            //]]>                                                                        
        </script>
    </head>
    <body class="BODY">
        <form runat="server" id="mainForm" method="post">
        <qsf:Header ID="Header1" runat="server" NavigationLanguage="c#" />
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" />
        <div class="module" style="width: 90%;">
            <b>Browser GUI: Alert, Prompt, Confirm</b><br />
            <hr />
            <br />
            <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
            </telerik:RadWindowManager>
            <table style="width: 100%;">
                <tr>
                    <td>
                        <h4>
                            Manipulate radalert and radconfirm content image:
                        </h4>
                        <asp:RadioButtonList ID="choices" runat="server">
                            <asp:ListItem Selected="True" Value="null" Text="Do not change (pass null or no arg)"></asp:ListItem>
                            <asp:ListItem Value="" Text="Remove (pass empty string)"></asp:ListItem>
                            <asp:ListItem Value="Img/mail.png" Text="Document relative url (pass string)"></asp:ListItem>
                            <asp:ListItem Value="http://www.telerik.com/favicon.ico" Text="Absolute url (pass string)"></asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                    <td style="width: 10px;">
                        &nbsp;
                    </td>
                    <td align="center">
                        <h4>
                            Dialogs called from client:
                        </h4>
                        <button style="width: 150px;" onclick="radalert('Radalert is called from the client!', 330, 100,'Client RadAlert', alertCallBackFn, imgUrl); return false;">
                            radalert from client</button><br style="clear: both" />
                        <br style="clear: both" />
                        <button style="width: 150px;" onclick="radconfirm('Client radconfirm: Are you sure?', confirmCallBackFn, 330, 100, null,'Client RadConfirm', imgUrl); return false;">
                            radconfirm from client</button><br style="clear: both" />
                        <br style="clear: both" />
                        <button style="width: 150px" onclick="radprompt('Client RadPrompt: What is the answer of Life, Universe and Everything?', promptCallBackFn, 330, 160, null, 'Client RadPrompt', '42'); return false;">
                            radprompt from client</button>
                        <br style="clear: both" />
                    </td>
                    <td style="width: 10px;">
                        &nbsp;
                    </td>
                    <td style="border-left: 1px solid #cccccc;" align="center">
                        <br />
                        <h4>
                            Dialogs called from server:
                        </h4>
                        <telerik:RadAjaxPanel ID="pnl1" runat="server">
    <asp:Button ID="btnAlert" Width="150" runat="server" OnCommand="Btn_OnCommand" Text="radalert from server"
    CommandArgument="radalert" />

                            <br style="clear: both" />
                            <br style="clear: both" />
    <asp:Button ID="btnConfirm" Width="150" runat="server" OnCommand="Btn_OnCommand"
    Text="radconfirm from server" CommandArgument="radconfirm" /><br style="clear: both" />

                            <br style="clear: both" />
    <asp:Button ID="btnPrompt" Width="150" runat="server" OnCommand="Btn_OnCommand" Text="radprompt from server"
    CommandArgument="radprompt" />

                        </telerik:RadAjaxPanel>
                        <br style="clear: both" />
                    </td>
                </tr>
            </table>
        </div>
        <br />
        <qsf:Footer runat="server" ID="Footer1" />
        </form>
    </body>
    </html>

Get more than expected!

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2012 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451