This is a migrated thread and some comments may be shown as answers.

Second Call to ajaxManager or ajaxPanel fails

1 Answer 48 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 08 Dec 2008, 12:08 AM
I'm having this issue regardless of if I i use a panel or the manager. I'm trying to refresh the screen and it works the first time I call it, but then I get ajaxMgr is null the second time I call it.  I have a popup window that has a form where the user enters in text, hits save, closes the window and has the screen refresh to the content they just typed.  Works first time, but if they open the window again and make changes, i can't get it to find the ajax manager.  Any ideas?

Popup Window code cs
RadAjaxCommentPanel.ResponseScripts.Add("Close();"); 

Popup Window code js
<script type="text/javascript"
    function Close() { 
 
        GetRadWindow().BrowserWindow.ReloadBodyTextBlock(); 
        GetRadWindow().close();   
    } 
    function GetRadWindow() 
    { 
      var oWindow = null
      if (window.radWindow) oWindow = window.radWindow; 
      else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; 
      return oWindow; 
    } 
    </script> 


Main window code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" MasterPageFile="~/MasterPage.master" %> 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<%@ MasterType VirtualPath="~/MasterPage.master" %> 
<asp:Content ContentPlaceHolderID="head" ID="head1" runat="server"
</asp:Content> 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server"></telerik:RadAjaxManagerProxy> 
    <telerik:RadCodeBlock ID="rcb" runat="server"
    <script type="text/javascript"
        function ReloadBodyTextBlock() { 
            var ajaxMgr = $find("<%=RadAjaxManager.GetCurrent(Page).ClientID %>"); 
            ajaxMgr.ajaxRequest("ReloadBodyText"); 
        } 
    </script>     
</telerik:RadCodeBlock>     
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"
    <div style="float: left; padding: 6px;"
        <asp:Panel ID="WelcomeText" runat="server"></asp:Panel> 
    </div> 
    <div style="float: right; border: solid 1px #dddddd; width: 300px;"
        <asp:Panel DefaultButton="LogIn" ID="LoginPanel" runat="server"
        <div style="padding: 5px;"
            <div style="margin-top: 10px;"
            <div style="float: left; width: 120px;">Email Address</div> 
            <div style="float: left; width: 150px;"
                <telerik:RadTextBox ID="EmailAddress" runat="server" Width="150px" MaxLength="100"></telerik:RadTextBox> 
            </div>     
            <div class="EndRow"></div> 
            <div style="padding-top: 10px;"></div> 
            <div style="float: left; width: 120px;">Password</div> 
            <div style="float: left; width: 150px;"
                <telerik:RadTextBox ID="Password" runat="server" TextMode="Password"  Width="150px" MaxLength="100" EmptyMessage=""></telerik:RadTextBox> 
            </div>     
            <div class="EndRow" style="padding-top: 10px;"></div> 
            <div style="padding-left: 120px"
                <asp:Button ID="LogIn" runat="server" Text="Log In" OnClick="LogIn_Click"/> 
            </div> 
        </div> 
        </div> 
        </asp:Panel> 
        <asp:Panel ID="UserBox" runat="server" Visible="false"
            <div style="padding: 5px;"
                <div style="float:left; padding-bottom: 5px;"
                    Welcome <asp:Label ID="MyName" runat="server"></asp:Label> 
                </div> 
                <div style="float: right; padding-bottom: 5px;"
                    <asp:LinkButton ID="Logout" runat="server" OnClick="Logout_Click" Text="[Logout]" CssClass="LinkButton" ></asp:LinkButton> 
                </div> 
                <div style="clear:both;"></div> 
                <asp:LinkButton ID="EditScreen" runat="server" CssClass="LinkButton" Text="[Edit Screen]" OnClientClick="EditBody(1); return false;"></asp:LinkButton> 
            </div> 
        </asp:Panel> 
    </div> 
    </telerik:RadAjaxPanel> 
</asp:Content> 



1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 09 Dec 2008, 02:59 PM
Hello John,

Will it be convenient for you to open a regular support ticket and send us small runnable project which replicates the described issue? We will test it locally and do our best to provide accurate solution.

Thank you for the cooperation.

Sincerely yours,
Maria Ilieva
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Ajax
Asked by
John
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or