Search code examples
c#asp.nettelerikpostbackradwindow

How to avoid postback on Radwindow Open?


I'm using radgrid for filling a form. The radwindow will be opened after the Open click.

<telerik:RadButton ID="create" Text="Open radwindow" runat="server" OnClientClicking="Open" AutoPostBack="false" CausesValidation="false" Skin="WebBlue" Font-Bold="true" Height="22px" Width="97px" ToolTip="Click here to Create a new meeting">
            </telerik:RadButton>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true" EnableViewState="false"></telerik:RadWindowManager>
<telerik:RadWindow id="radCreatePopup" NavigateUrl="page2.aspx"  Top="30" OnClientShow="OnClientshow" Left="100" VisibleStatusbar="false"
     Modal="true" CenterIfModal="true" OnClientClose="Close" runat="server" Width="770px" Height="390px" Skin="WebBlue" Behaviors="Resize, Close, Move, Reload" ReloadOnShow="True" />

Javascript code for open and close`

        (function (global, undefined) {
            var button = null;
            function OnClientshow(sender, eventArgs) {
            }
            function Open() {
                var oWnd = $find("<%= radCreatePopup.ClientID %>").show();
            }
            global.OnClientshow = OnClientshow;
            global.Open = Open;
        })(window);

        function Close() {
            var oWnd = $find("<%= radCreatePopup.ClientID %>").Close();
            rebind();
            return false;
        }

Everything works fine, but if i open Radwindow the parent page will be postedback again and again.


Solution

  • Since you are using ReloadOnShow="True" radwindow will do the reload on everytime. so remove the code and run it.