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

Weird issue with updating RadWindow's contents

1 Answer 49 Views
Window
This is a migrated thread and some comments may be shown as answers.
Iris
Top achievements
Rank 1
Iris asked on 22 May 2014, 03:57 AM
I have a asp page containing a linkbutton.  When it is clicked, the server side behind code will retrieve some text from database. Then display it in a div block inside a RadWindow.

The issue was that when the RadWindow was popped up for the first time by clicking the button, ABC was displayed . When you clicked the button again, the retrieved text was displayed. Could anyone help? Thanks!

Below is the code:

The linkButton behind code:

protected void button1_Click(object sender, EventArgse) {
       String text = retrieve(...);
       string script = string.Format("showResult (\"{0}\");",text);  
       RadAjaxManager.GetCurrent(Page).ResponseScripts.Add(script);
}

js code:

var rwNoneEditable = '<%=rwNoneEditable.ClientID%>'
function showResult (text) {
    $("#carInfo").html(text);
    alert($("#carInfo").html());//show the text
    var radW = $find('<%=rwNoneEditable.ClientID%>');
    radW .show();
}

RadWindow asp:

<asp:UpdatePanel ID="upNoneEditable" runat="server" UpdateMode="Conditional" RenderMode="Inline">
    <ContentTemplate>
    <telerik:RadWindow ID="rwNoneEditable" runat="server" Modal="true" Behaviors="Close, Move, Resize"
        VisibleStatusbar="False" Width="700px" Height="600px" VisibleTitlebar="True" Title="Test" >
        <ContentTemplate>
            <div id="carInfo" style="overflow: scroll; width: 100%; height: 100%;" visible="true">
                    ABC
            </div>
        </ContentTemplate>
    </telerik:RadWindow>
    </ContentTemplate>
 </asp:UpdatePanel>

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 23 May 2014, 08:49 AM

Hello Iris,

I am attaching a simple page here that seems to work fine for me. Could you compare it with your real setup and find the difference that causes the issue? Perhaps the AJAX setup causes nested update panels and/or settings, so you would have to remove them. I also advise that you examine this help article on working with AJAX in the ContentTemplate of a RadWindow: http://www.telerik.com/help/aspnet-ajax/radwindow-ajaxifying.html. Also, make sure there are no script errors caused by improperly terminated strings when the HTML from the code-behind passes through the JavaScript function as an argument.


Regards,

Marin Bratanov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Window
Asked by
Iris
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or