I want to open a multiple RadWindows from my page one after the other. How can I do it ?
For example: I have login.aspx page with "Forget Password ?" link.
When user click that link, I want to open recover password Model pop-up which is radwindow and the page is recoverpassword.aspx. Once user can specify require details and entered detail is correct then I have to close the "recover password" pop-up which is recoverpassword.aspx page, then I want to open "security question" pop-up which is my SecurityQuestion.aspx. If user provide correct data for question then I want to close that pop-up Radwindow which is my SecurityQuestion.aspx after performing some operation.
In these operations, I dont want to refresh my login.aspx page.
Any help ?
Thanks
7 Answers, 1 is accepted
Hi Tejas,
There are a two approaches you can take:
1) when the respective button (OK or Send for example) within the RadWindow is opened you can get a reference to the RadWindow and change its Url so that the next page is loaded inside. This way you will be using only one RadWindow. For more information on the available methods and the way to get a reference to the RadWindow from within its content page please examine the following articles:
- http://www.telerik.com/help/aspnet-ajax/window-programming-opening-from-within-dialog.html
- http://www.telerik.com/help/aspnet-ajax/window-programming-radwindow-methods.html
2) you can get a reference to the browser window and open a new RadWIndow from there via JavaScript:
First get a reference to the window as described in the first article, then call the function from the main window (accessing it via the BrowserWindow property) that will open the second popup and then in the same button handler call the first window's close() method. The same procedure can be repeated for the second - click the button, get the reference, call the close method. For more information on calling a function from the main page please see the following article: http://www.telerik.com/help/aspnet-ajax/window-programming-calling-functions.html.
On the ways to open a RadWindow please see this page: http://www.telerik.com/help/aspnet-ajax/window-programming-opening.html.
For your convenience I created and attached a small sample that shows these suggestions in action.
I hope my reply was helpful.
Regards,
Marin
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Thanks for the reply and providing demo. It works fine.
But unfortunately, I want to close the popups (both RadWindows) from server side after performing some action and not at the client side.
Right now, It does not reach to my server event of button click.
In addition, while using same window and changing just URL, I found that once close the second window and try to open windows again redirects me to the second window instead of the first window, URL resetting problem.
Any suggestion ?
Thanks
Hello Tejas,
You stated that you do not want to refresh the parent page and this is why I used only JavaScript to do the necessary (thus cancelling the postbacks). If you wish to have server-side handlers for the buttons you can simply move the functionality you wish to the server side and after that inject a JavaScript call to the function that closes the RadWindow (the OpenNextWindow() and closeMe() respectively). How to do that is explained in the following blog post: http://blogs.telerik.com/supportdept/posts/09-05-05/executing_javascript_function_from_server-side_code.aspx. In short the syntax you need is similar to this:
string
script =
"function f(){OpenNextWindow();Sys.Application.remove_load(f);}Sys.Application.add_load(f);"
;
ScriptManager.RegisterStartupScript(
this
,
this
.GetType(),
"key"
, script,
true
);
Please note that you need a script manager on the page in order for this event to be available.
As for the URL - the setUrl() method changes the NavigateUrl of the RadWindow and this is the expected behavior. If you wish to use one window you can simply call this method when you show it for the first time (from the main page in the openFirstWindow() function) to force the desired url to be the first loaded every time.
All the best,
Marin
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Thanks for this solution. It works fine for me now !!!
Thanks again :)
Can some one help me on this issue.
Hi srivalli,
This sounds like a concurrency issue with the data source and it is not something our controls affect or can take care of. You may find the following resources helpful on catering for such scenarios:
- http://stackoverflow.com/questions/1195858/how-to-deal-with-concurrent-updates-in-databases.
- http://blog.sqlauthority.com/2012/11/15/sql-server-concurrency-basics-guest-post-by-vinod-kumar/.
Regards,
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.