I am still in a telerik evaluation phase and working with an evaluation copy.
I am very new to web-application development, so forgive me if my question is dump.
From a record-selection form I want to allow the user to call multiple update forms.
This works without problems.
But if I close one or all of the individual update forms and than call up additionally update-forms, all the previously created forms are popping up again. What have I forgotten?
To demonstrate my problem see the following example.
Just press the [New RadWindow] button multiple times.
Then close all created windows by pressing [Close Window].
When you then press the [New RadWindow] all the previously created forms and a new one are showing.
How can I supress the showing of previusly closed forms?
Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title> <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" /></head><body> <form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> <Scripts> <%--Needed for JavaScript IntelliSense in VS2010--%> <%--For VS2008 replace RadScriptManager with ScriptManager--%> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" /> </Scripts> </telerik:RadScriptManager> <script type="text/javascript"> //Put your JavaScript code here. </script> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> </telerik:RadAjaxManager> <div> <telerik:RadWindowManager ID="RadWindowManager1" runat="server"> </telerik:RadWindowManager> </div> <telerik:RadButton ID="RadButton1" runat="server" onclick="RadButton1_Click" Text="New RadWindow"> </telerik:RadButton> <asp:RadioButtonList ID="RadioButtonList1" runat="server"> <asp:ListItem>use Form.Controls.Add</asp:ListItem> <asp:ListItem Selected="True">use RadWindowManager.Add</asp:ListItem> </asp:RadioButtonList> </form></body></html>Default.aspx.cs
using System;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using System.Configuration;using System.Web.Security;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using Telerik.Web.UI;public partial class Default : System.Web.UI.Page { public static int Counter = 0; protected void Page_Load(object sender, EventArgs e) { } protected void RadButton1_Click(object sender, EventArgs e) { RadWindow window1 = new RadWindow(); window1.NavigateUrl = "WebForm2.aspx"; window1.ID = string.Format("NonModalForm{0}", Counter++.ToString()); window1.Title = window1.ID; window1.Behaviors = Telerik.Web.UI.WindowBehaviors.Close | Telerik.Web.UI.WindowBehaviors.Resize | Telerik.Web.UI.WindowBehaviors.Move; window1.Top = 80 + Counter * 20; window1.Left = Counter * 20; window1.Width = 200; window1.Height = 100; window1.Modal = false; window1.KeepInScreenBounds = true;// false; // seem to have no effect ( tested with IE ); window1.VisibleStatusbar = false; window1.ShowContentDuringLoad = false; window1.EnableViewState = true;// false; window1.DestroyOnClose = false; // if true I get error in my real app. window1.VisibleOnPageLoad = true; switch (RadioButtonList1.SelectedValue) { case "use Form.Controls.Add" : this.Form.Controls.Add(window1) ; break; // this will show the window - but did not show multiple non-modal windows. case "use RadWindowManager.Add": RadWindowManager1.Windows.Add(window1); break; // RadWindowManager needed to show multiple non-modal windows - but Manager did not release windows. } }}WebForm2.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="RadControlsWebApp_FormFLow.WebForm2" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title></head><body> <form id="form1" runat="server"> <div> <telerik:RadScriptManager ID="RadScriptManager1" Runat="server"> </telerik:RadScriptManager> <telerik:RadCodeBlock id="RadCodeBlock1" runat="server"> <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; } </script> </telerik:RadCodeBlock> <telerik:RadButton ID="RadButton1" runat="server" Text="Close Form" onclick="RadButton1_Click"> </telerik:RadButton> </div> </form></body></html>WebForm2.aspx.cs
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using RadControlsWebApp_FormFLow;namespace RadControlsWebApp_FormFLow{ public partial class WebForm2 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void RadButton1_Click(object sender, EventArgs e) { // close RadWindow ClientScript.RegisterStartupScript(GetType() , "WindowCloseScript" , "<script type='text/javascript'> var oWindow = GetRadWindow(); oWindow.Close(); </script>" ); } }}