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">
        <script type="text/javascript">
            function click123() {
                var oWnd = document.getElementById("RadWindow1");
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
                <asp:ScriptReference Assembly="Telerik.Web.UI" 
                <asp:ScriptReference Assembly="Telerik.Web.UI" 
                <asp:ScriptReference Assembly="Telerik.Web.UI" 
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            Welcome to the RadWindow Page.. 
        <telerik:RadWindow ID="RadWindow1" runat="server" NavigateUrl="http://www.google.com">
        <br />
        <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="click123()" />
        <br />      

  2. Marin Bratanov
    Marin Bratanov avatar
    3567 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.

    Marin Bratanov

    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. DevCraft R3 2016 release webinar banner
Back to Top