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

Passing Server Arguments from Dialog to Main Page

1 Answer 55 Views
Window
This is a migrated thread and some comments may be shown as answers.
Justin
Top achievements
Rank 1
Justin asked on 19 Apr 2012, 08:52 PM
Hello,
I know there is an example on the Demos page to pass server arguments to the dialog from the main page, but I would like to reverse that and pass server arguments from the dialog to the main page. So if the user changes data in the dialog it would pass back to the main page like MainPage.aspx?CustomerID=AROUT.

Is this possible? If it is, how would I go about doing it?

Thanks!
Justin

1 Answer, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 23 Apr 2012, 01:26 PM
Hi Justin,

Since the two pages are entirely separate there are several ways you can achieve passing the value from one to the other:

1) build the data on the content page, store it in the session, cache or database and when closing the RadWindow perform an AJAX request in the main page to get it. Similar approach is shown in this online demo.

OR

2) if it is a simple string like your example you can pass it as a JavaScript argument when closing the RadWindow. How to do this is shown in this help article and this online demo. You can take it from the server to the client in your content page easily, for example in a hidden field or by directly injecting the script that will close the RadWindow. You can then either use it via JavaScript, you can perform an AJAX request, etc.

OR

3) change the URL of the main page to provide the argument as a querystring, e.g.: window.top.location.href = window.top.location.href + "?CustomerID=" + myData     Note that this will fully reload the parent page.


Kind regards,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Window
Asked by
Justin
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or