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 Q2 2011 released 07/12/2011
select

Window / Localization

Configuration
Choose language:

  • Localization

    RadWindow and RadWindowManager provide a mechanism for quick and easy localization, based on the native ASP.NET 2.0 localization. All UI strings for command buttons are obtained from the resource files located in the WebSite's App_GlobalResources directory, so that the language of the RadWindow is automatically switched to the culture and UI culture of the Web page.

    The name of the resource file (RadWindow in this case) and the string to read must be specified in the Localization property for each of the tooltips/buttons you wish to localize (in this demo the string name matches the command name/button text).

    The example uses the approach described in this Microsoft help article to programmatically change the culture and UI culture of an ASP.NET Web page.

    Each of the localization strings can be modified at runtime using the Localization property. This saves the need to create a new localization file to change a single string.

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="c#" AutoEventWireup="true" Inherits="Telerik.Web.Examples.Window.Localization.DefaultCS"
        CodeFile="DefaultCS.aspx.cs" %>

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <!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 ID="Headtag1" runat="server" />
        <style type="text/css">
            .controlButtons, .controlButtons li
            {
                padding: 0;
                margin: 0;
                list-style: none;
            }
            
            .controlButtons li
            {
                padding: 4px 8px;
            }
            
            .controlButtons button
            {
                width: 154px;
            }
            
            #RadWindow2_C
            {
                background-color:White;
            }
        </style>
        <script type="text/javascript">
         //<![CDATA[
            function confirmCallBackFn(arg)
            {
                radalert("<strnog>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 OpenAlert()
            {
                radalert('<h4>Welcome to <strong>RadWindow</strong>!</h4>', 330, 100, 'RadAlert custom title');
                return false;
            }
            function OpenConfirm()
            {
                radconfirm('<h3 style=\'color: #333399;\'>Are you sure?</h3>', confirmCallBackFn, 330, 100, null, 'RadConfirm custom title');
                return false;
            }
            function OpenPrompt()
            {
                radprompt('<span style=\'color: #333399;\'>What is the answer of Life, Universe and Everything?</span>', promptCallBackFn, 330, 160, null, 'The Question', '42');
                return false;
            }
                //]]>
        </script>
    </head>
    <body class="BODY">
        <form id="Form1" method="post" runat="server">
        <qsf:Header ID="Header1" runat="server" NavigationLanguage="c#" />
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="All">
        </telerik:RadFormDecorator>
        <telerik:RadAjaxManager ID="ajaxManager" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="rblLanguages">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <qsf:ConfiguratorPanel ID="ConfiguratorPanel1" runat="server" Title="Configuration"
            Orientation="Horizontal" Expanded="true">
            <div style="margin-bottom: 10px; margin-left: 20px;">
                <strong>Choose language:</strong></div>
    <asp:RadioButtonList ID="rblLanguages" runat="server" RepeatDirection="Horizontal"
    AutoPostBack="True" Style="margin-left: 40px;">

                <asp:ListItem Value="de-DE">Deutsch</asp:ListItem>
                <asp:ListItem Selected="true" Value="en-US">English</asp:ListItem>
                <asp:ListItem Value="fr-FR">Francais</asp:ListItem>
            </asp:RadioButtonList>
        </qsf:ConfiguratorPanel>
        <div style="height: 400px; width: 670px; float: left;">
        </div>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
            <Localization Maximize="<%$ Resources:RadWindow, Maximize %>" Minimize="<%$ Resources:RadWindow, Minimize %>"
                Close="<%$ Resources:RadWindow, Close %>" PinOff="<%$ Resources:RadWindow, PinOff %>"
                PinOn="<%$ Resources:RadWindow, PinOn %>" Reload="<%$ Resources:RadWindow,Reload %>"
                Restore="<%$ Resources:RadWindow, Restore%>" Cancel="<%$ Resources:RadWindow, Cancel %>"
                OK="<%$ Resources:RadWindow, OK %>" No="<%$ Resources:RadWindow, No %>" Yes="<%$ Resources:RadWindow, Yes %>" />
            <Windows>
                <telerik:RadWindow ID="RadWindow1" runat="server" VisibleOnPageLoad="true" Width="320"
                    Left="550" Top="350" NavigateUrl="http://www.telerik.com">
                </telerik:RadWindow>
                <telerik:RadWindow ID="RadWindow2" runat="server" Width="320" VisibleOnPageLoad="true"
                    Left="880" Top="350">
                    <ContentTemplate>
                        <h2>
                            &nbsp;RadWindow with ContentTemplate set!</h2>
    <asp:Image ID="img" runat="server" ImageUrl="~/Window/TestPage/TestPageResources/RadWindow.gif"
    Style="width: 220px; height: 46px; top: 50%; left: 50%; position: absolute; margin-left: -110px;
    margin-top: -23px;" alt="" />

                    </ContentTemplate>
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
        <div style="float: right;">
            <ul class="controlButtons" style="margin-top: 25px;">
                <li>
                    <button onclick="return OpenAlert()">
                        Open radalert</button></li>
                <li>
                    <button onclick="return OpenPrompt()">
                        Open radprompt</button></li>
                <li>
                    <button onclick="return OpenConfirm()">
                        Open radconfirm</button></li>
            </ul>
        </div>
        <div class="qsfClearFloat">
            <!-- -->
        </div>
        <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-2024 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451