window.RadOpen() equivalent in ASP.NET AJAX

8 posts, 1 answers
  1. Yash
    Yash avatar
    27 posts
    Member since:
    Sep 2010

    Posted 07 Oct 2010 Link to this post

    I am presently working on a project of migrating from telerik controls for asp.net to asp.net ajax. I am facing a lot of issues, on how to access the radcontrols specially radwindow and radgrid using javascript. One of the main ones is,

    window.RadOpen(url, radwindowID);

    It always throws an error here saying it is 'undefined'..never saw any threads on this issue, so posting it on the forum.
    Please let me know what has to be done.

    Thank you in advance

    Regards
    Yash
  2. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 07 Oct 2010 Link to this post

    Hello Yash,

    It should look like this:

    window.radopen(url, radWindowID);

    It's all lowercase.

    I hope that helps.
  3. Yash
    Yash avatar
    27 posts
    Member since:
    Sep 2010

    Posted 07 Oct 2010 Link to this post

    Hello, I and my team member did some tweaking and we found that the RadWindow manager is not working when a content page inherits from a master Page. Is there a fix to it? I am attaching a file example to this one. I followed the exact same steps as told in the tutorials of RadWindows for ASP.NET AJAX. Please let me know whats the issue with this. Thank you.

    <%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
        CodeBehind="Default.aspx.cs" Inherits="radWindowExample._Default" %>

    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

    <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    </asp:Content>
    <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server"
            Behavior="Default" InitialBehavior="None" Skin="Windows7">
            <Windows>
                <telerik:RadWindow runat="server" Behavior="Default" InitialBehavior="None"
                    NavigateUrl="http://www.google.com" Title="RadWindowExample"
                    OpenerElementID="btnGoogle" ID="radWindow1" VisibleOnPageLoad="False"
                    VisibleStatusbar="False" VisibleTitlebar="True">
                </telerik:RadWindow>
                
                <telerik:RadWindow ID="rwDialog" runat="server" Behavior="Default"
                    InitialBehavior="None" Modal="True" NavigateUrl="WebForm1.aspx"
                    OpenerElementID="btnDialog">
                </telerik:RadWindow>
            </Windows>
    </telerik:RadWindowManager>

    <h2>
            Welcome to Example Project..!!
        </h2>
        <asp:Button ID="btnGoogle" runat="server" Text="Show Google" />
        <asp:Button ID="btnDialog" runat="server" Text="Show Dialog"
            style="z-index: 1; left: 21px; top: 0px; position: relative"
            UseSubmitBehavior="False" CausesValidation="False" />
        <p>
            To learn more about ASP.NET visit <a href="http://www.asp.net" title="ASP.NET Website">www.asp.net</a>.
        </p>
        
        <p>
            
        </p>
        </asp:Content>

    //------------------------CODE BEHIND----------------------------------//
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    namespace radWindowExample
    {
        public partial class _Default : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {

            }
        }
    }

    //---------------SITE.MASTER PAGE----------------------------//
    <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="radWindowExample.SiteMaster" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head runat="server">
        <title></title>
        <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
        <asp:ContentPlaceHolder ID="HeadContent" runat="server">
        </asp:ContentPlaceHolder>
    </head>
    <body>
        <form runat="server">
        <div class="page">
            <div class="header">
                <div class="title">
                    <h1>
                        My ASP.NET Application
                    </h1>
                </div>
                <div class="loginDisplay">
                    <asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false">
                        <AnonymousTemplate>
                            [ <a href="~/Account/Login.aspx" ID="HeadLoginStatus" runat="server">Log In</a> ]
                        </AnonymousTemplate>
                        <LoggedInTemplate>
                            Welcome <span class="bold"><asp:LoginName ID="HeadLoginName" runat="server" /></span>!
                            [ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/"/> ]
                        </LoggedInTemplate>
                    </asp:LoginView>
                </div>
                <div class="clear hideSkiplink">
                    <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal">
                        <Items>
                            <asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"/>
                            <asp:MenuItem NavigateUrl="~/About.aspx" Text="About"/>
                        </Items>
                    </asp:Menu>
                </div>
            </div>
            <div class="main">
                <asp:ContentPlaceHolder ID="MainContent" runat="server"/>
            </div>
            <div class="clear">
            </div>
        </div>
        <div class="footer">
            
        </div>
        </form>
    </body>
    </html>

  4. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 08 Oct 2010 Link to this post

    Hi Yash,

    As noted in the documentation and the demo, the OpenerElementID and OffsetElementID properties expect a ClientID - when you move your code in a content page, the ID and the ClientID of the button are different, hence the problem.

    Best wishes,
    Georgi Tunev
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  5. Yash
    Yash avatar
    27 posts
    Member since:
    Sep 2010

    Posted 08 Oct 2010 Link to this post

    In the demo,
    Windows>
                    <%-- RadWindow1's OpenerElementID is set in codebehind --%>
                    <telerik:RadWindow
                        ID="RadWindow1"
                        Title="Sofia"
                        NavigateUrl="http://wap.gomobi.com.ua/us/weather.php?c_id=100&t_id=2870" runat="server">
                    </telerik:RadWindow>


    //-----------------------------code for button related to the above radwindow is-----------------------------------//
    <asp:Button ID="SofiaBtn" runat="server" Style="width: 179px;" Text="Sofia">
                </asp:Button>&nbsp;&nbsp;


    How does this part of the code work? without a OpenerElementID ??

    Regards
    Yash
  6. Answer
    Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 08 Oct 2010 Link to this post

    Hi Yash,

    The comment that you see in the code is pretty self-explanatory - if you check the demo's codebehind page, you will notice the following code:
    protected void Page_Load(object sender, EventArgs e)
    {
        RadWindow1.OpenerElementID = SofiaBtn.ClientID;
    }

    The same information is available in the demo's description.

    Greetings,
    Georgi Tunev
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  7. Yash
    Yash avatar
    27 posts
    Member since:
    Sep 2010

    Posted 08 Oct 2010 Link to this post

    So, if I want to use RadWindowManager/RadWindow controls in a content page inherited from a Master Page, how can I do it??

    In this case, I have my RadWindowmanager and the buttons which are OpenerElements are in the same page. Nothing that is related to the controls is inherited from the MasterPage.

    Please tell me how to do it ?? Both RadControls and Master Pages play a vital role in the project I am working on.

    However, the RadWindowManager/RadWindow controls worked with master pages with telerik Radcontrols for ASP.NET (the classic controls).

    Regards
    Yash
  8. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 08 Oct 2010 Link to this post

    Hello Yash,

    To open a RadWindow that is inside the MasterPage from the content Page's button, you would do something like this:

    <asp:Button ID="Button1" runat="server" OnClientClick="radopen('url','RadWindowName');return false;">
    </
    asp:Button>

    I hope that helps.
Back to Top