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

How do you return a value from a rad window to the calling page?

4 Answers 143 Views
Window
This is a migrated thread and some comments may be shown as answers.
Acadia
Top achievements
Rank 1
Iron
Acadia asked on 22 Aug 2008, 04:42 PM
I just want to return a simple string from the rad window to the calling page when the window closes. 

Thanks

4 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 25 Aug 2008, 12:28 PM
Hi Acadia,

Please check the following documentation topic
http://www.telerik.com/help/aspnet-ajax/window_programmingusingradwindowasadialog.html

and the corresponding demo for information on how to do this:
http://www.telerik.com/demos/aspnet/prometheus/Window/Examples/DialogReturnValue/DefaultCS.aspx



Greetings,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Acadia
Top achievements
Rank 1
Iron
answered on 26 Aug 2008, 07:23 PM
Thanks for the response, but neither lin answered my question.

I am opening my rad window from the server code as follows . . .

User clicks a button on the main page which calls this method:

Private Sub btnLookup_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLookup.Click

Dim newWindow As New Telerik.Web.UI.RadWindow

newWindow.ID =

"jsW"

newWindow.Height =

"300"

newWindow.Width =

"650"

newWindow.Behaviors = WindowBehaviors.Move

newWindow.OnClientClose =

"OnClientClose"

newWindow.NavigateUrl =

"myWindow.aspx?criteria=" & tbJCriteria.Text & "&user=" & "SSAWYER"

newWindow.VisibleOnPageLoad =

True

Master.Page.Form.Controls.Add(newWindow)

End Sub


The rad window opens fine and receives its parameters and functions just fine.

Once the user is done within the rad window, he closes the window.  At that time when he closes the window I would like to be able to pass a few string values as arguments from the rad window to the main page where the button was and capture those values for processing on the main page.

How can I do this?  I can't find a single example of this that isn't fully javascripted and I'm opening my window from the server side not in javascript.

Thanks.
0
Accepted
Tervel
Telerik team
answered on 27 Aug 2008, 08:06 AM
Hello Acadia,

It is essential to distinguish between client-side and server-side functionality. While RadWindow is configured on the server-side, it opens on the client-side, and the page that is loaded into the window can only communicate to the invoking page using client script. This is not a desktop environment with paren/child forms that offer unified programming model.

The examples suggested use exactly the approach that should be used. In case you wish to process the values returned to the parent page on the server-side, you should put them into a hidden field, and submit the page. An alternative option would be to use AJAX. Please refer to the following example that uses a RadGrid and a RadWindow as a row-editor. When the user completes editing the data, and presses OK, the RadWindow page is submitted on the server, the database is updated, then the page is reloaded, and by using a couple of lines of javascript, it causes the parent page RadGrid to refresh so as to demonstrate the updated values.
http://demos.telerik.com/aspnet/prometheus/Controls/Examples/Integration/GridAndWindow/DefaultCS.aspx?product=grid


Best wishes,
Tervel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Acadia
Top achievements
Rank 1
Iron
answered on 27 Aug 2008, 01:22 PM
Thanks this led me in the right direction!
Tags
Window
Asked by
Acadia
Top achievements
Rank 1
Iron
Answers by
Georgi Tunev
Telerik team
Acadia
Top achievements
Rank 1
Iron
Tervel
Telerik team
Share this question
or