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

radwindow parameters to code-behind

1 Answer 124 Views
Window
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 16 Jan 2012, 04:55 PM

I would like to know the best way to utilise a radwindow for the following scenario.

in my application im setting a link to allow a user to mark where their location is on google maps. the google map is being loaded in a radwindow, im currently passing the record id and postcode to the map page via a querystring. is this the best way or is there an alternative?

where im having a problem is i want to include a button whereby the user clicks after moving the marker and this function will close the window and pass the parameters for id, postcode, lat + lng coordinates to the calling page.

the samples ive found are client side but i need the parameter values server side as i want to update a database record with the coorinates related to the location set by the user.

i also need a way to deal with the user closing the window via the x in the corner rather than my button. maybe a prompt?

so the main issue is, once the user clicks the button to close the window how do i get the values in my code-behind module?

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 17 Jan 2012, 02:55 PM
Hello Mark,

On opening the RadWindow - I am not sure what your scenario exactly is, but using the querystring to pass arguments is one of the quickest ways to command a page that is loaded in an iframe, so if this functionailty is currently working for you I believe you can continue using it.

Passing values through the code-behind between different pages is a general ASP task that does not depend on the RadWindow. It is up to the developer to create this functionality, yet I can suggest you use either a global class to store the information or a session variable.

Alternatively, you can get the values on the client via JavaScript (including on the OnClientBeforeClose event, where you can also add a confirmation dialog) and pass them via JavaScript to the parent page. Then you can place the data in a hidden field and perform an AJAX request to get them to the server.


All the best,
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
Mark
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or