RadWindow show is not working

2 posts, 0 answers
  1. Kunal Bagga
    Kunal Bagga avatar
    26 posts
    Member since:
    Oct 2008

    Posted 13 Mar 2014 Link to this post

    Hi I am doing a very simple example of showing a RadWindow on click of a Button. But the window never shows up. 

    Here is the aspx page that I have

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RadWindow.aspx.cs" Inherits="DotNetExercises.RadWindow" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <script type="text/javascript">
            function click123() {
                alert("Hello");
                var oWnd = document.getElementById("RadWindow1");
                alert(oWnd);
                oWnd.show();
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" 
                    Name="Telerik.Web.UI.Common.Core.js">
                </asp:ScriptReference>
                <asp:ScriptReference Assembly="Telerik.Web.UI" 
                    Name="Telerik.Web.UI.Common.jQuery.js">
                </asp:ScriptReference>
                <asp:ScriptReference Assembly="Telerik.Web.UI" 
                    Name="Telerik.Web.UI.Common.jQueryInclude.js">
                </asp:ScriptReference>
            </Scripts>
        </telerik:RadScriptManager>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        </telerik:RadWindowManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
        <div>
            Welcome to the RadWindow Page.. 
        </div>
        <telerik:RadWindow ID="RadWindow1" runat="server" NavigateUrl="http://www.google.com">
        </telerik:RadWindow>
        <br />
        <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="click123()" />
        <br />      
        </form>
    </body>
    </html>  








  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3600 posts

    Posted 13 Mar 2014 Link to this post

    Hi Kunal,

    I strongly advise that you start by examining the following help article that explains how to open RadWindows: http://www.telerik.com/help/aspnet-ajax/window-programming-opening.html.
    The key points related to your code are:
    - you need to use  $find() instead of document.getElementById();
    - it is advisable to use the ClientID from the server via server code blocks to accommodate for ID changes by ASP.
    - you should cancel the postback from the button by adding a return false; statement to the script.

    Regards,
    Marin Bratanov
    Telerik

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

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