Passing Server Arguments from Dialog to Main Page

2 posts, 1 answers
  1. Justin
    Justin avatar
    24 posts
    Member since:
    Sep 2011

    Posted 19 Apr 2012 Link to this post

    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
  2. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    5704 posts

    Posted 23 Apr 2012 Link to this post

    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.
Back to Top