Maged Samaan
Maged Samaan

Reputation: 1752

RadWindow issue

I'm using RadWindow in update panel like:

<asp:UpdatePanel ID="mainUpdatePanel" runat="server">
    <ContentTemplate>
        <telerik:RadWindow ID="wndInformation" runat="server" Skin="Default"
                NavigateUrl="../MaterialInformation.aspx"
                Behaviors="Close, Move, Resize, Maximize" Height="500" Width="600">
        </telerik:RadWindow>

and calling it using javascipt:

function OpenSuperSeeding() {
            var wnd = $find("<%= wndInformation.ClientID%>");
            wnd.show();
        }

and assigned like in tags:

<asp:LinkButton runat="server" ID="LnkbtnStatistics"
     OnClientClick="OpenSuperSeeding()">

The problem is it pops up and close immediately? Why?

Upvotes: 0

Views: 5784

Answers (2)

GeorgiTunev
GeorgiTunev

Reputation: 480

The asp:linkbutton is a postback element - that is the reason why the RadWindow closes immediately. Basically, what happens is:

  1. You click the link button

  2. The function in the OnClientClick event handler is fired and shows the window

  3. Postback occurs and the page is reloaded - at this point, the RadWindow object is destroyed (just like any other dynamically created object on a postback).

To avoid this, you need to cancel the postback:

<asp:LinkButton runat="server" ID="LnkbtnStatistics" Text="Link Button" OnClientClick="OpenSuperSeeding(); return false;"></asp:LinkButton>

Upvotes: 3

Rob
Rob

Reputation: 1390

It might be because of the UpdatePanel. Did you try moving the RadWindow code out of the UpdatePanel code and see if it still closes immediately? If you have the Telerik suite you might consider using their Ajax controls instead. They're pretty powerful and Telerik generally tests the compatibility of their controls when they're used in conjunction with each other. The RadAjaxManager is a very good control and allows fine grained control of Ajax updates - much better than UpdatePanel.

Upvotes: 1

Related Questions