How to avoid postback on Radwindow Open?

I use radgrid to fill out the form. The pleased window will open after clicking Open .

<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 openand 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 returned again and again.

+4
source share
2 answers

Since you are using ReloadOnShow = "True" , rawindow will reboot every time. so delete the code and run it.

+1
source

What happens if you try to change OnClientClicking to OnClientClicked

or try

OnClientClicking="function() { Open(); return false; }"
0

Source: https://habr.com/ru/post/1599236/


All Articles