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

Radwindow Disappears and Reappears when updating ajaxified control

2 Answers 104 Views
Window
This is a migrated thread and some comments may be shown as answers.
Nils C.
Top achievements
Rank 1
Nils C. asked on 17 Jul 2012, 05:55 PM
Hi there!

We have a Radwindow with a couple of server-controls in its ContentTemplate (i.e. a ComboBox, a TextBox...). The entire Content is ajaxified using an asp:panel directly within the ContentTemplate.

The RadWindow is opened from a RadButton via a client-side script. However, the button needs to perform a partial postback, because the controls within the RadWindiw need to be updated conditionally (server-side). Because of this, we set the RadWindow's VisibleOnPageLoad property to "true" in the button's server Click event (in order to prevent the RadWindow from closing after the partial postback).

The expected (and wanted) behavior would be: 
  1. Button Click
  2. RadWindow opens directly (javascript)
  3. Ajax-Loader shows, the RadWindow's content is updated and the RadWindow stays visible

What happens is:
  1. Button Click
  2. RadWindow opens directly (javascript)
  3. Ajax-Loader shows and the RadWindow's content is updated
  4. Radwindow disappears and directly reappears (blinks) <-- This is unwanted and quite annoying to the user

What is causing the fourth step (why the annoying blinking-effect)? Any help or suggestion would be very much appreciated!!

Hans



2 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 20 Jul 2012, 03:30 PM
Hi Hans,

You can use RadWindow with ContentTeamplate. In the content template put an Asp:Panel. In the RadAjax settings ajaxify the button that will open RadWindow and update the panel information, e.g.

Default.aspx:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="ShowRadWindow1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="Label1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<asp:Button Text="Show RadWindow" ID="ShowRadWindow1" runat="server"
    onclick="ShowRadWindow1_Click" OnClientClick="openRadWindow();" />
<telerik:RadWindow id="RadWindow1" runat="server">
    <ContentTemplate>
        <asp:Label ID="Label1" runat="server">
            sample content
        </asp:Label>
    </ContentTemplate>
</telerik:RadWindow>
<script type="text/javascript">
    function openRadWindow() {
        var wnd = $find("RadWindow1");
        wnd.show();
        return false;
    }
    </script>

Default.aspx.cs
protected void ShowRadWindow1_Click(object sender, EventArgs e)
{
    Label.Text = DateTime.Now.ToString();
}



All the best,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Nils C.
Top achievements
Rank 1
answered on 10 Aug 2012, 08:00 PM
Just in case anyone comes across this thread. We finally solved the issue. Turns out we missed an ajaxified panel further up in our usercontrol hierarchy. It caused a much greater ajax-callback than we actually wanted. Once it was removed, everything worked as expected!

Hans
Tags
Window
Asked by
Nils C.
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Nils C.
Top achievements
Rank 1
Share this question
or