简体   繁体   中英

RadWindow close on Navigated page

I open a radwindow on my drop down selectedindex changed and navigate the window to a diff page.

 <telerik:RadWindow runat="server" ID="RadWindow1"  NavigateUrl="Default1.aspx"  Width="500px"></telerik:RadWindow>

Can some one suggest..how can i close the RadWindow1 in Default1 "Close" button click.

Place the following code inside Default1 which is loaded inside RadWindow1 .

It basically calls RadWindow's close function when a button is clicked.

Inside Default1

<script type="text/javascript">

   function getRadWindow() {
      var oWindow = null;
      if (window.radWindow) 
         oWindow = window.radWindow;
      else if (window.frameElement.radWindow) 
         oWindow = window.frameElement.radWindow;
      return oWindow;
   }

   function onClientClicked(sender, eventArgs) {
      getRadWindow().close();
   }

</script>

<telerik:RadButton ID="CloseRadButton" runat="server" AutoPostBack="false" 
   Text="Close" OnClientClicked="onClientClicked">
</telerik:RadButton>

The RadWindow has a close button on it. This button should just work to close the window.

Take a look at the demos around opening and closing the RadWindow on the Telerik support page: http://demos.telerik.com/aspnet-ajax/window/examples/radopen/defaultcs.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM