Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
252 views
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");
                }
            }
        }
    }
}
Marin Bratanov
Telerik team
 answered on 28 Jun 2013
1 answer
143 views
Hello,
is possible in a aspx page write uppercase characters in the fields radtextbox and radcombobox?
Shinu
Top achievements
Rank 2
 answered on 28 Jun 2013
3 answers
99 views
Hi Telerik Team,

I am facing a problem with Rad window control. I have opened a Radwinow inside a RadTabsrip,Every time when I click on the  tabs the Rad window keeps shifting up words on the Tabs.

Please suggest some solution ASAP.

Thanks in Advance,
Raj


Marin Bratanov
Telerik team
 answered on 28 Jun 2013
1 answer
100 views
I have two columns in my grid, that during edit mode, I would like them to be depending on each other.

I have a template column with a check box and a template column dropdown list.

If the check box is checked by Client, I want to set the selected value back the first option.  If the user selects any item in the drop down list, I want to un-check the check box.

I am looking into the RadScriptBlock to use some JS ; but any help would be greatly appreciated.
Princy
Top achievements
Rank 2
 answered on 28 Jun 2013
6 answers
836 views
Hi , 
i want to use HTML Chart to display a graph like this in the attached pic   ( untitled1.png).
With the data from database that have records like in the attached  pic  ( untitled2.png). 

How do i achieve two series of lines in the HTML chart,
currently it binds to only one series.



Thanks in advance,
Ricky

Danail Vasilev
Telerik team
 answered on 28 Jun 2013
10 answers
671 views
Hi,

How can I customize radconfirm? I need to add an asp label and an image in radconfirm?
Shinu
Top achievements
Rank 2
 answered on 28 Jun 2013
3 answers
115 views
Hi,

I'm trying to implement grid filtering like it works in SPGridView. I made a custom column which was bounded to the same table as RadGrid.

I want to apply sequential filtering on columns (if user selects filter value from first column, then all other columns should limit results based on this criteria). User can filter by multiple columns in grid.

How can I achieve this?

Marko
Tsvetoslav
Telerik team
 answered on 28 Jun 2013
3 answers
290 views
Hi guys

I am using radasyncupload to upload multiple files to the server. By default how can I overwrite if the selected file is already uploaded in the server? Any help would be great.
Thanks
Sameer
Shinu
Top achievements
Rank 2
 answered on 28 Jun 2013
5 answers
211 views
We have a project using the rad dock controls and when I drag a dock from one zone to another it is possible to get the dock to lose its connection to the pointer.   To do this I basically just move the dock down below the scrollbar line then move it back up.  My mouse indicator becomes a pointer when this happens instead of the standard cross pointer you see when moving a dock.  

has anyone else experienced this or know of a fix for it.


I performed a pretty complete search trying to look for anyone else having this issue and was unable to find anything.  
Slav
Telerik team
 answered on 28 Jun 2013
2 answers
437 views
Hallo, 

I made a page with a radgrid on it. At first the page had a asp script manager. But when i put in an RadAjaxLoadingPanel it gave the error
"A control is already associated with the element." After looking on the internet I found a solution. I replaced the script manager in my master layout with the radscriptmanager. I registered it both for IIS6 and IIS7. Now when i load the grid it still shows but when i want to do anything with it, it gives the error. "Object of type 'Telerik.Web.UI.GridDataItem' cannot be converted to type 'Sys.UI.Control'". 
It gives the error when I try to use any feature of the grid. When i use a button in the command bar, after doing the onclick, it gives the error. When i try to edit a record, it gives the error. After giving the error the grid stops working. 

<asp:EntityDataSource ID="edsBackups" runat="server" EntitySetName="Backups" ConnectionString="name=ControlwareEntities"
        DefaultContainerName="ControlwareEntities" EnableFlattening="False" EnableUpdate="True"
        EntityTypeFilter="" OrderBy="it.DateTime DESC" Select="">
    </asp:EntityDataSource>
   
    <telerik:RadGrid runat="server" ID="cg" DataSourceID="edsBackups" OnUpdateCommand="cg_UpdateCommand"
        OnDeleteCommand="cg_DeleteCommand"
         
        AllowPaging="True"
        AllowSorting="True"
        >
        <MasterTableView DataKeyNames="ID">
            <CommandItemTemplate>
                <div style="padding: 5px 5px;">
                    <asp:LinkButton ID="LinkButton2" runat="server" OnClick="bBackup_OnClick"><img style="border:0px;vertical-align:middle;" alt=""  width="15" src="/Styles/glyphicons/glyphicons_342_hdd.png"/> <asp:Literal ID="Literal1" meta:resourcekey="NewBackup" runat="server" Text="New"></asp:Literal></asp:LinkButton>  
                    <asp:LinkButton ID="btnEditSelected" runat="server" CommandName="EditSelected"><img style="border:0px;vertical-align:middle;" alt=""  width="15" src="/Styles/glyphicons/glyphicons_030_pencil.png" /> <asp:Literal ID="Literal2" meta:resourcekey="EditBackup" runat="server" Text="Edit"></asp:Literal></asp:LinkButton>  
                    <asp:LinkButton ID="LinkButton1" runat="server" CommandName="DeleteSelected"><img style="border:0px;vertical-align:middle;" alt=""  width="15" src="/Styles/glyphicons/glyphicons_016_bin.png"/> <asp:Literal ID="Literal3" meta:resourcekey="DeleteBackup" runat="server" Text="Delete"></asp:Literal></asp:LinkButton>  
                    <asp:LinkButton ID="LinkButton5" runat="server" OnClick="bRestore_OnClick"><img style="border:0px;vertical-align:middle;" alt=""  width="15" src="/Styles/glyphicons/glyphicons_082_roundabout.png"/> <asp:Literal ID="Literal4" meta:resourcekey="RestoreBackup" runat="server" Text="RestoreBackup"></asp:Literal></asp:LinkButton>  
                    <asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid"><div style="float:right"><img style="border:0px;vertical-align:middle" alt="" width="15" src="/Styles/glyphicons/glyphicons_081_refresh.png"/> <asp:Literal ID="Literal5" meta:resourcekey="RefreshBackup" runat="server" Text="Refresh"></asp:Literal></asp:LinkButton>
                </div>
            </CommandItemTemplate>
            <EditFormSettings EditFormType="Template" InsertCaption="New" CaptionFormatString="Edit">
                <FormTemplate>
                    <div style="padding: 5px">
                        <table id="Table2" width="100%" border="0" style="border-collapse: collapse; padding: 5px">
                            <tr>
                                <td colspan="2"><b>Backup:</b></td>
                            </tr>
                            <tr>
                                <td>Created On:</td>
                                <td><asp:Label runat="server" Text='<%# Eval("DateTime") %>'></asp:Label></td>
                            </tr>
                            <tr>
                                <td>Name:</td>
                                <td><asp:TextBox ID="TextBox1" Style="width: 200px;" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox></td>
                            </tr>
                            <tr>
                                <td>
                                    Full Backup:
                                </td>
                                <td>
                                    <asp:CheckBox Enabled="False" runat="server" ID="cb1" Checked='<%# Bind("IsFullBackup") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" style="padding: 5px">
                                    <asp:LinkButton ID="btnCancel" runat="server" CommandName="CancelAll" Visible='<%# cg.EditIndexes.Count > 0 || cg.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt=""  width="15" src="/Styles/glyphicons/glyphicons_221_unshare.png"/> Cancel</asp:LinkButton>  
                                    <asp:LinkButton ID="btnUpdateEdited" runat="server" CommandName="UpdateEdited" Visible='<%# cg.EditIndexes.Count > 0 %>'><img style="border:0px;vertical-align:middle;" alt=""  width="15" src="/Styles/glyphicons/glyphicons_003_user.png"/> Update</asp:LinkButton>  
                                </td>
                            </tr>
                        </table>
                    </div>
                </FormTemplate>
            </EditFormSettings>
            <Columns>
                <telerik:GridBoundColumn HeaderText="ID" DataField="ID" Visible="False" />
                <telerik:GridBoundColumn meta:resourcekey="GridColumn1" HeaderText="Timestamp" DataField="DateTime" />
                <telerik:GridBoundColumn meta:resourcekey="GridColumn2"  HeaderText="Name" DataField="Name" />
                <telerik:GridCheckBoxColumn meta:resourcekey="GridColumn3" HeaderText="Full Backup" DataField="IsFullBackup" />
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>

I also found out that it gives the same error with the raddropdownlist
Leander
Top achievements
Rank 1
 answered on 28 Jun 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?