or


<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="RadWindowTest.aspx.vb" Inherits="WebApp.RadWindowTest" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title></head><body> <form id="form1" runat="server"> <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server"> </telerik:RadStyleSheetManager> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> <Scripts> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js"> </asp:ScriptReference> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js"> </asp:ScriptReference> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js"> </asp:ScriptReference> </Scripts> </telerik:RadScriptManager> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> </telerik:RadAjaxManager> <div> <telerik:RadWindowManager ID="RadWindowManagerParent" runat="server" Animation="None" RenderMode="Lightweight" OffsetElementID="WindowAnchor" RestrictionZoneID="DivContent" EnableTheming="true" Opacity="100" AnimationDuration="0" DestroyOnClose="true" EnableShadow="true" PreserveClientState="true" ShowContentDuringLoad="False" ShowOnTopWhenMaximized="False" Width="1000" Height="600" VisibleStatusbar="false" ReloadOnShow="false" KeepInScreenBounds="False" Style="z-index: 2501;" Behaviors="Close,Maximize,Minimize,Move,Reload,Resize" EnableViewState="False"> <Windows> <telerik:RadWindow ID="RadWindow1" runat="server" VisibleOnPageLoad="true" NavigateUrl="RadWindowContent.aspx"> </telerik:RadWindow> </Windows> </telerik:RadWindowManager> </div> </form></body></html><%@ Page Language="vb" AutoEventWireup="false" CodeBehind="RadWindowContent.aspx.vb" Inherits="WebApp.RadWindowContent" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title></head><body> <form id="form1" runat="server"> <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server"> </telerik:RadStyleSheetManager> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> <Scripts> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js"></asp:ScriptReference> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js"></asp:ScriptReference> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js"></asp:ScriptReference> </Scripts> </telerik:RadScriptManager> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> </telerik:RadAjaxManager> <div> <table width="100%" border="0" cellspacing="2" cellpadding="0"> <tr> <td width="250" align="left" valign="top"> <asp:Panel ID="PnlSearch" runat="server" DefaultButton="BtnSearch"> <div align="left"> <telerik:RadPanelBar ID="RadPanelbarSearch" runat="server" CollapseAnimation-Duration="100" CollapseAnimation-Type="Linear" ExpandAnimation-Duration="100" ExpandAnimation-Type="Linear" ExpandMode="SingleExpandedItem" Width="300px"> <Items> <telerik:RadPanelItem runat="server" Expanded="true" Text="Search Criteria"> <Items> <telerik:RadPanelItem runat="server"> <ItemTemplate> <table border="0" cellpadding="0" cellspacing="2" width="280"> <tr id="TrSelect" runat="server"> <td width="115px"> <span>View:</span> </td> <td> <asp:RadioButtonList ID="RblSelect" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" AutoPostBack="true"> <asp:ListItem Text="Single" Value="single"></asp:ListItem> <asp:ListItem Text="Multi" Value="multi" Selected="True"></asp:ListItem> </asp:RadioButtonList> </td> </tr> <tr id="TrOffice" runat="server"> <td width="117"> <asp:HyperLink ID="hlOffice" runat="server" href="" TabIndex="-1">Office:</asp:HyperLink> </td> <td width="153"> <asp:TextBox ID="txtOffice" runat="server" Width="135px" MaxLength="4" TabIndex="1"></asp:TextBox> </td> </tr> <tr id="TrClient" runat="server"> <td> <asp:HyperLink ID="hlClient" runat="server" TabIndex="-1" NavigateUrl="~/Blank.htm"><span>Client:</span></asp:HyperLink> </td> <td> <asp:TextBox ID="txtClient" runat="server" Width="135px" TabIndex="1" MaxLength="6"></asp:TextBox> </td> </tr> <tr id="TrDivision" runat="server"> <td> <asp:HyperLink ID="hlDivision" runat="server" TabIndex="-1" NavigateUrl="~/Blank.htm"><span>Division:</span></asp:HyperLink> </td> <td> <asp:TextBox ID="txtDivision" runat="server" Width="135px" TabIndex="2" MaxLength="6"></asp:TextBox> </td> </tr> <tr id="TrProduct" runat="server"> <td> <asp:HyperLink ID="hlProduct" runat="server" TabIndex="-1" NavigateUrl="~/Blank.htm"><span>Product:</span></asp:HyperLink> </td> <td> <asp:TextBox ID="txtProduct" runat="server" Width="135px" TabIndex="3" MaxLength="6"></asp:TextBox> </td> </tr> <tr id="TrSalesClass" runat="server"> <td> <asp:HyperLink ID="hlSalesClass" runat="server" href="" TabIndex="-1"><span>Sales Class:</span></asp:HyperLink> </td> <td> <asp:TextBox ID="txtSalesClass" runat="server" Width="135px" TabIndex="4" MaxLength="6"></asp:TextBox> </td> </tr> <tr id="Tr4" runat="server"> <td> <asp:HyperLink ID="HlCampaign" runat="server" TabIndex="-1" NavigateUrl="~/Blank.htm"><span>Campaign:</span></asp:HyperLink> </td> <td> <asp:TextBox ID="TxtCampaign" runat="server" MaxLength="6" TabIndex="5" Text="" Width="135px"></asp:TextBox> <asp:HiddenField ID="hfCampaignID" runat="server" /> </td> </tr> <tr id="TrJobNum" runat="server"> <td> <asp:HyperLink ID="hlJob" runat="server" TabIndex="-1" NavigateUrl="~/Blank.htm"><span>Job:</span></asp:HyperLink> </td> <td> <asp:TextBox ID="txtJob" runat="server" Width="135px" TabIndex="6" MaxLength="6"></asp:TextBox> </td> </tr> <tr id="TrJobComp" runat="server"> <td> <asp:HyperLink ID="hlComponent" runat="server" TabIndex="-1" NavigateUrl="~/Blank.htm"><span>Component:</span></asp:HyperLink> </td> <td> <asp:TextBox ID="txtComponent" runat="server" Width="135px" MaxLength="6" TabIndex="7"></asp:TextBox> </td> </tr> <tr id="Tr2" runat="server"> <td> <asp:HyperLink ID="HlAccountExecutive" runat="server" TabIndex="-1" NavigateUrl="~/Blank.htm"><span>AE:</span></asp:HyperLink> </td> <td> <asp:TextBox ID="TxtAccountExecutive" runat="server" MaxLength="6" TabIndex="8" Text="" Width="135px"></asp:TextBox> </td> </tr> <tr id="Tr0" runat="server"> <td> </td> <td> </td> </tr> <tr id="Tr1" runat="server"> <td> <asp:HyperLink ID="HlManager" runat="server" TabIndex="-1" NavigateUrl="~/Blank.htm"></asp:HyperLink> </td> <td> <asp:TextBox ID="TxtManager" runat="server" MaxLength="6" TabIndex="9" Text="" Width="135px"></asp:TextBox> </td> </tr> <tr id="Tr3" runat="server"> <td colspan="2"> <asp:CheckBox ID="ChkExcludeCompletedSchedules" runat="server" Checked="True" TabIndex="10" Text="" />Exclude Completed Schedules </td> </tr> <tr id="Tr13" runat="server"> <td> </td> <td> </td> </tr> <tr id="Tr5" runat="server"> <td> <span>Phase:</span> </td> <td> <telerik:RadComboBox ID="DropPhaseFilter" runat="server" TabIndex="11" AppendDataBoundItems="true" DropDownWidth="175" Width="137" Visible="true"> <Items> <telerik:RadComboBoxItem Text="[No Filter]" Value="no_filter"></telerik:RadComboBoxItem> </Items> </telerik:RadComboBox> </td> </tr> <tr id="Tr7" runat="server"> <td> <asp:HyperLink ID="HlRole" runat="server" TabIndex="-1" NavigateUrl="~/Blank.htm"><span>Role:</span></asp:HyperLink> </td> <td> <asp:TextBox ID="TxtRole" runat="server" MaxLength="6" TabIndex="12" Text="" Width="135px"></asp:TextBox> </td> </tr> <tr id="Tr9" runat="server"> <td> <asp:HyperLink ID="HlTask" runat="server" TabIndex="-1" NavigateUrl="~/Blank.htm"><span>Task:</span></asp:HyperLink> </td> <td> <asp:TextBox ID="TxtTaskCode" runat="server" MaxLength="10" TabIndex="13" Text="" Width="135px"></asp:TextBox> </td> </tr> <tr id="Tr11" runat="server"> <td> <asp:HyperLink ID="HlEmployee" runat="server" TabIndex="-1" NavigateUrl="~/Blank.htm"><span>Employee:</span></asp:HyperLink> </td> <td> <asp:TextBox ID="TxtEmployee" runat="server" MaxLength="6" TabIndex="14" Text="" Width="135px"></asp:TextBox> </td> </tr> <tr id="Tr12" runat="server"> <td> <span>Date Cutoff:</span> </td> <td> <telerik:RadDatePicker ID="RadDatePickerDateCutoff" runat="server" MinDate="1950-01-01" DatePopupButton-ToolTip="Show calendar" MaxDate="2050-01-01" Width="163px"> <DateInput DateFormat="d" EmptyMessage="Start Date" TabIndex="15"> <IncrementSettings InterceptArrowKeys="true" InterceptMouseWheel="true" /> </DateInput> <Calendar ID="CalendarStartDate" RangeMinDate="1900-01-01" runat="server" RenderMode="Lightweight"> <SpecialDays> <telerik:RadCalendarDay Repeatable="Today" ItemStyle-BackColor="LightSalmon"> </telerik:RadCalendarDay> </SpecialDays> </Calendar> </telerik:RadDatePicker> </td> </tr> <tr id="Tr6" runat="server"> <td colspan="2"> <asp:CheckBox ID="ChkOnlyPendingTasks" runat="server" TabIndex="16" Text="" />Only Pending Tasks </td> </tr> <tr id="Tr8" runat="server"> <td colspan="2"> <asp:CheckBox ID="ChkExcludeProjectedTasks" runat="server" TabIndex="17" Text="" />Exclude Projected Tasks </td> </tr> <tr id="Tr10" runat="server"> <td colspan="2"> <asp:CheckBox ID="ChkIncludeCompletedTasks" runat="server" Checked="True" TabIndex="18" Text="" />Include Completed Tasks </td> </tr> </table> </ItemTemplate> </telerik:RadPanelItem> </Items> </telerik:RadPanelItem> </Items> </telerik:RadPanelBar> </div> <div style="display: none;"> <asp:Button ID="BtnSearch" runat="server" Text="Search" Visible="true" TabIndex="-1" /> </div> </asp:Panel> </td> <td align="left" valign="top"> <telerik:RadToolBar ID="RadToolbarSearch" runat="server" AutoPostBack="true" Width="100%" TabIndex="-1"> <Items> <telerik:RadToolBarButton IsSeparator="true" /> <telerik:RadToolBarButton ID="RadToolbarButtonSearch" ImageUrl="Images/Find.png" Text="Search" Value="Search" ToolTip="Search" /> <telerik:RadToolBarButton IsSeparator="true" /> <telerik:RadToolBarButton ID="RadToolbarButtonNew" ImageUrl="Images/add2.png" ToolTip="New" Text="New" Value="New" /> <telerik:RadToolBarButton IsSeparator="true" /> <telerik:RadToolBarButton ID="RadToolbarButtonClear" ImageUrl="Images/undo.png" Text="Clear" Value="Clear" ToolTip="Clear" /> <telerik:RadToolBarButton ImageUrl="Images/bookmark16.png" Text="" Value="Bookmark" ToolTip="Bookmark" Visible="false" /> <telerik:RadToolBarButton IsSeparator="true" /> </Items> </telerik:RadToolBar> <telerik:RadGrid ID="RadGridProjectScheduleSearch" runat="server" AllowSorting="True" AutoGenerateColumns="False" GridLines="None" GroupingSettings-GroupByFieldsSeparator=" " AllowPaging="true" PageSize="15" EnableEmbeddedSkins="True"> <PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="true" Position="Bottom"></PagerStyle> <SortingSettings SortedAscToolTip="Sorted ascending" SortedDescToolTip="Sorted descending" /> <ClientSettings AllowColumnsReorder="False"> </ClientSettings> <GroupingSettings GroupByFieldsSeparator=" " /> <MasterTableView HorizontalAlign="Left" DataKeyNames="JOB_NUMBER,JOB_COMPONENT_NBR"> <Columns> <telerik:GridTemplateColumn> <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="18px" /> <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="18px" /> <ItemTemplate> <asp:ImageButton ID="butDetail" runat="server" CommandName="Detail" ImageAlign="AbsMiddle" TabIndex="21" ImageUrl="~/Images/view-trans.png" /> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn Visible="false"> <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="18px" /> <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="18px" /> <ItemTemplate> <asp:ImageButton ID="ImgBtnPrint" runat="server" CommandName="Print" ImageAlign="AbsMiddle" ToolTip="Print/Send Schedule" ImageUrl="~/Images/printer2-trans.png" /> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Job Number" SortExpression="JOB_NUMBER"> <HeaderStyle HorizontalAlign="left" VerticalAlign="Middle" Width="70px" /> <ItemStyle HorizontalAlign="left" VerticalAlign="Middle" Width="70px" /> <ItemTemplate> <asp:Label ID="lblJobNum" runat="server" Text='<%#Eval("JOB_NUMBER")%>'></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Job Description" SortExpression="JOB_DESC"> <HeaderStyle HorizontalAlign="left" VerticalAlign="Middle" /> <ItemStyle HorizontalAlign="left" VerticalAlign="Middle" /> <ItemTemplate> <asp:Label ID="lblJobDesc" runat="server" Text='<%#Eval("JOB_DESC")%>'></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Component Number" SortExpression="JOB_COMPONENT_NBR"> <HeaderStyle HorizontalAlign="left" VerticalAlign="Middle" Width="70px" /> <ItemStyle HorizontalAlign="left" VerticalAlign="Middle" Width="70px" /> <ItemTemplate> <asp:Label ID="lblJobComp" runat="server" Text='<%#Eval("JOB_COMPONENT_NBR")%>'></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Component Description" SortExpression="JOB_COMP_DESC"> <HeaderStyle HorizontalAlign="left" VerticalAlign="Middle" /> <ItemStyle HorizontalAlign="left" VerticalAlign="Middle" /> <ItemTemplate> <asp:Label ID="lblJobCompDesc" runat="server" Text='<%#Eval("JOB_COMP_DESC")%>'></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Client" SortExpression="CL_CODE"> <HeaderStyle HorizontalAlign="left" VerticalAlign="Middle" Width="55" /> <ItemStyle HorizontalAlign="left" VerticalAlign="Middle" Width="55" /> <ItemTemplate> <asp:Label ID="lblClientCode" runat="server" Text='<%#Eval("CL_CODE")%>'></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Division" SortExpression="DIV_CODE"> <HeaderStyle HorizontalAlign="left" VerticalAlign="Middle" Width="55" /> <ItemStyle HorizontalAlign="left" VerticalAlign="Middle" Width="55" /> <ItemTemplate> <asp:Label ID="lblDivisionCode" runat="server" Text='<%#Eval("DIV_CODE")%>'></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Product" SortExpression="PRD_CODE"> <HeaderStyle HorizontalAlign="left" VerticalAlign="Middle" Width="55" /> <ItemStyle HorizontalAlign="left" VerticalAlign="Middle" Width="55" /> <ItemTemplate> <asp:Label ID="lblProductCode" runat="server" Text='<%#Eval("PRD_CODE")%>'></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> <FilterItemStyle VerticalAlign="Top" Wrap="False" /> <ExpandCollapseColumn Visible="False"> <HeaderStyle Width="19px" /> </ExpandCollapseColumn> <RowIndicatorColumn Visible="False"> <HeaderStyle Width="20px" /> </RowIndicatorColumn> </MasterTableView> </telerik:RadGrid> </td> </tr> </table> </div> </form></body></html>I have two forms and a Popup control. These two forms work kinda of like a Wizard. On the first form there is a "Next" button which when clicked will bring up a Popup, which when closed will do a doPostback from the client and on the server side it redirects to Form2. On Form2 Now if you click the Previous button, it does a Postback and I hide the Popup. But if the user clicks the Browser back button, the Popup shows up and I want to hide the Popup. And when the user closes the Popup it will redirect them to the Form2, which kinda of goes into a loop, So I want to close the Popup when the user clicks on the Browser back button so that they can stay on Form1. The Browser back button doesn't do a Postback so none of the server side stuff works. I tried to write JS and JQuery on "pageLoad()" it goes into that but all of this fires before the Popup comes up. It just loads it from the cache. Also tried to expire the Cache but I get an empty page. Refresh is not an option for me at this point as there are more than two pages in my flow, and when I refresh it always goes to First page with our architecture. Any way to close this pop-up? Your help would be greatly appreciated. Thanks in advance....Form1.aspx--------------------------------------------------<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Form1.aspx.cs" Inherits="Popup.Form1" %> <%@ Register Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" TagPrefix="telerik" %> <%@ Register TagPrefix="uc" TagName="Popup" Src="Popup.ascx" %> <body> <form id="form1" runat="server"> <div> <uc:Popup ID="idPopup" runat="server" /> <span style="font-size: 15px; font-weight: bold;">My first form....</span> </br></br> Please click on the Next button.... </br></br> <asp:Button ID="btnNext" runat="server" Text="Next" OnClick="btnNext_Click" /> </div> </form> </body> </html> Form1.aspx.cs --------------------------------------------------
using System; namespace Popup { public partial class Form1 : System.Web.UI.Page { protected override void OnLoad(EventArgs e) { idPopup.ClosePopup(); } protected void btnNext_Click(object sender, EventArgs e) { idPopup.ShowPopup(); } } }Form2.aspx-------------------------------------------<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Form2.aspx.cs" Inherits="Popup.Form2" %> <body> <form id="form1" runat="server"> <div> <span style="font-size: 15px; font-weight: bold;">My second form....</span> </br></br> Now if you click the Previous button, it does a Postback and I hide the Popup. But if the user clicks the Browser back button, the Popup shows up and I want to hide the Popup. <br /> <br /> And when the user closes the Popup it will redirect them to the Form2.So I want to close the Popup when the user clicks on the Browser back button so that they can stay on Form1. </br></br><asp:Button ID="btnPrevious" runat="server" Text="Previous" OnClick="btnPrevious_Click" /> <asp:Button ID="btnNext" runat="server" Text="Next" /> </div> </form> </body> </html>Form2.aspx.cs-------------------------------------------using System; namespace Popup { public partial class Form2 : System.Web.UI.Page { protected void btnPrevious_Click(object sender, EventArgs e) { Response.Redirect("Form1.aspx"); } } }Popup.ascx-------------------------------------------<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Popup.ascx.cs" Inherits="Popup.Popup1" %> <%@ Register Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" TagPrefix="telerik" %> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <asp:Panel runat="server" ID="pnlPopup"> <telerik:RadWindowManager runat="server" ID="WindowManager" DestroyOnClose="False"> <Windows> <telerik:RadWindow ID="PopupWindow" Modal="true" Behaviors="Move, Close" runat="server" OnClientClose="clientClose"> <ContentTemplate> This Popup comes up with some information and when the user closes it, it does a __doPostBack and on the server side it redirects to the Form2. </ContentTemplate> </telerik:RadWindow> </Windows> </telerik:RadWindowManager> </asp:Panel> <telerik:RadScriptBlock ID="scrAffiliate" runat="server"> <script type="text/javascript"> //Function helps to potback the form once the pop-up is closed function clientClose(sender, args) { __doPostBack('__Page', 'SubmitPopup'); } function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } } </script> </telerik:RadScriptBlock>Popup.ascx.cs-------------------------------------------using System; using System.Web.UI; namespace Popup { public partial class Popup1 : System.Web.UI.UserControl { public void ShowPopup() { this.PopupWindow.VisibleOnPageLoad = true; } public void ClosePopup() { this.PopupWindow.VisibleOnPageLoad = false; } protected override void OnLoad(EventArgs e) { if (Page.IsPostBack) { string eventArg = Request.Form["__EVENTARGUMENT"]; if (eventArg == "SubmitPopup") { ClosePopup(); Response.Redirect("Form2.aspx"); } } } } }