This is a migrated thread and some comments may be shown as answers.

Opening multiple RadWindow popups

7 Answers 490 Views
Window
This is a migrated thread and some comments may be shown as answers.
Tejas
Top achievements
Rank 1
Tejas asked on 07 Jun 2011, 06:16 PM
Hi,
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

Sort by
0
Marin Bratanov
Telerik team
answered on 08 Jun 2011, 02:49 PM

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:

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.

0
Tejas
Top achievements
Rank 1
answered on 08 Jun 2011, 06:15 PM
Hi Marin,

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
0
Marin Bratanov
Telerik team
answered on 09 Jun 2011, 03:56 PM

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.

0
Tejas
Top achievements
Rank 1
answered on 13 Jun 2011, 08:14 PM
Hi Marin,

Thanks for this solution. It works fine for me now !!!

Thanks again :)


0
srivalli kothapalli
Top achievements
Rank 1
answered on 28 Oct 2014, 02:23 PM
Im trying to open radwindow on radgrid image button click event. It woks fine when one user is trying to save data on radwindow. But issue is when there are multiple users on the application and on same page and trying to enter their data on radwindow its not saving data correctly.


Can some one help me on this issue.
0
Marin Bratanov
Telerik team
answered on 29 Oct 2014, 01:28 PM

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:


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.

 
0
srivalli kothapalli
Top achievements
Rank 1
answered on 29 Oct 2014, 03:35 PM
Can you please share some samples how to deal with multiple users saving/updating data on radwindow
Tags
Window
Asked by
Tejas
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Tejas
Top achievements
Rank 1
srivalli kothapalli
Top achievements
Rank 1
Share this question
or