The moment the window opens it directly is closed automatically again.
As seen here: http://hama.ontwikkelruimte.nl
Put something in the shopcart and go to Warenkorb, try to login, there is the problem.
Any clue?
Marc
3 Answers, 1 is accepted
Please have a look into the sample code snippet which works fine at my end. Try to replicate the issue in the provided code or please provide a sample code for further help.
ASPX:
<telerik:RadAjaxPanel ID="rajxpnlWindow" runat="server"> <telerik:RadButton ID="rbtnOpenWin" runat="server" Text="OpenWindow"> </telerik:RadButton> <telerik:RadWindow ID="rwindowDemo" runat="server" OpenerElementID="rbtnOpenWin"> <ContentTemplate> <telerik:RadTextBox ID="rtxtUserName" runat="server"> </telerik:RadTextBox> <telerik:RadButton ID="rbtnLogin" runat="server" Text="Login"> </telerik:RadButton> </ContentTemplate> </telerik:RadWindow></telerik:RadAjaxPanel>Thanks,
Shinu.
I created testpage on http://hama.ontwikkelruimte.nl/test.aspx
with following code:
<telerik:RadAjaxPanel ID="rajxpnlWindow" runat="server"> <telerik:RadButton ID="rbtnOpenWin" runat="server" Text="This is a RadButton"> </telerik:RadButton> <telerik:RadWindow ID="rwindowDemo" runat="server"> <ContentTemplate> <telerik:RadTextBox ID="rtxtUserName" runat="server"> </telerik:RadTextBox> <telerik:RadButton ID="rbtnLogin" runat="server" Text="Login"> </telerik:RadButton> </ContentTemplate> </telerik:RadWindow></telerik:RadAjaxPanel> <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"> <asp:Button ID="Button1" runat="server" Text="This is a ASP.NET button" /> <telerik:RadWindow ID="RadWindow1" runat="server"> <ContentTemplate> <telerik:RadTextBox ID="RadTextBox1" runat="server"> </telerik:RadTextBox> <telerik:RadButton ID="RadButton1" runat="server" Text="Login"> </telerik:RadButton> </ContentTemplate> </telerik:RadWindow> </telerik:RadAjaxPanel>rwindowDemo.OpenerElementID = rbtnOpenWin.ClientID RadWindow1.OpenerElementID = Button1.ClientIDI hope you can see the difference between the version opened with the RadButton and the native ASP Button.
Please get back to me...
Marc
Hi Marc,
The button that opens the RadWIndow is configured to do a postback when it is clicked and you need to prevent that. RadWindow's popup element is generated with JavaScript when it needs to be opened, so the postback from the button disposes it and thus - it hides.
Generally, using the OpenerElementID property should prevent the postback because it cancels the click event. In this case, the RadAjaxPanel captures the button click in order to make the partial postback, so a postback still occurs. To avoid that, you can add a simple script to do the job, for example:
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"><telerik:RadCodeBlock runat="server" ID="RadCodeBlock1"> <script type="text/ecmascript"> function openRw() { $find("<%=RadWindow1.ClientID%>").show(); } </script></telerik:RadCodeBlock> <asp:Button ID="Button1" OnClientClick="openRw(); return false;" runat="server" Text="This is a ASP.NET button" /> <telerik:RadWindow ID="RadWindow1" runat="server"> <ContentTemplate> <telerik:RadTextBox ID="RadTextBox1" runat="server"> </telerik:RadTextBox> <telerik:RadButton ID="RadButton1" runat="server" Text="Login"> </telerik:RadButton> </ContentTemplate> </telerik:RadWindow></telerik:RadAjaxPanel>On a side note, I also advise that you examine this article to see how to use the RadWIndow's ContentTemplate with AJAX: http://www.telerik.com/help/aspnet-ajax/window-ajaxifying.html. It seems to me that you need the RadAjaxPanel in the RadWindow's ContentTemplate, not around the entire control and the button. Moving it there will let you again use the OpenerElementID property because the opener button will not be ajax-enabled.
Regards, Marin Bratanov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.