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

RadWindow postback base page refresh

5 Answers 624 Views
Window
This is a migrated thread and some comments may be shown as answers.
Mark DeMichele
Top achievements
Rank 1
Mark DeMichele asked on 18 Jan 2008, 03:25 PM
I want to do something with the RadWindow and wanted to check first if it's possible before I spend too much time.  Here's what I want do to.

1.  I have a page that displays some details for of a data object. 

2.  I would like to put a link on part of this page to pop up a modal RadWindow with some edit fields and an OK/Cancel button to allow the user to edit these details.

3.  When the user clicks OK on the popup, I want the popup to do a postback to process the data and store it int he DB.  I then want the popup to go away.

4.  After the data is stored by the postback of the popup, I want the base window to refresh and reload the new data from the DB.

Is this an intended scenario for the RadWindow?  If so, are there examples, or do you have suggestions on how to do it.

Thanks,
Mark DeMichele

5 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 18 Jan 2008, 04:11 PM
Hi Mark,

Yes, this can be achieved by using the RadWindow control. There is detailed information about the different steps in the following articles:

Step 2: Open the RadWindow from a link: online demo
            Populating the edit fields with data from the browser window: online demo

Step 3 and 4: Perform a postback, manipulate data, make the window close automatically and reload the parent browser page after the postback, to display the changes   online kb article with sample projects

I hope this information will get you started. Please note that the RadWindow control is intended to replace the browser's popup (e.g. window.open()) and just like the browser's popup or the IFRAME element, it is simply a container which displays a content page, different from the parent one. Since there are 2 different pages, the communication between them should be done on the client by using JavaScript.

This being said, if you experience problems, we would recommend to implement the desired logic by using not a RadWindow but a standard popup. Once you have your application working as expected, please send us that project and we will rework it for you so it uses RadWindow.




All the best,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Lester
Top achievements
Rank 1
answered on 18 Mar 2010, 05:46 PM
Hi.

I am asking a value thru radprompt, and in the javascript callfunction i want to send that value back to the server and use it in server side code, what is the best way to achieve this ?
0
Georgi Tunev
Telerik team
answered on 19 Mar 2010, 03:57 PM
Hello Lester,

Just as the standard prompt dialog, radprompt is created and handled on the client only. To achieve the desired result, once you receive the argument from the radprompt dialog on the client(it is returned in the CallbackFunction), it must be sent to the server after that.
This (sending arguments from the client to the server with JavaScript) is a general programming task - for example you can use __doPostBack() or RadAjax's ajaxRequest call to do this.

You may also find the following Code Library article helpful - it was submitted by a customer of ours:
http://www.telerik.com/community/code-library/aspnet-ajax/window/server-side-msgbox-user-control-for-radconfirm-radalert-and-radprompt.aspx


Greetings,
Georgi Tunev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Charles
Top achievements
Rank 2
answered on 22 Mar 2010, 02:26 PM
Hi.

The link to the knowledgebase article is not active. I keep getting a page that gives a "server error".

I need to do something similar. I have launched a RadWindow from a base page using the Window Manager and a Javascript function to create and show the window. Within the RadWindow, a record is edited or added to the database. The add/edit button runs on the server and updates the database.

I need to close the window upon a successful update or add. I can't find a way to do that.

I have no problem communicating values back to the base window - I already have a Javascript function on the RadWindow that is able to pass values to the close() method so that the base window gets values and I can update that.

But...I need to run the server side code within the RadWindow that updates the database AND I need to close this window upon a successful update.

Thanks for any help you can provide.
0
Georgi Tunev
Telerik team
answered on 24 Mar 2010, 07:41 AM
Hi Charles,

I checked the link and it opened fine - I guess there was a temporary problem with the server.
As for your question, in your case I suggest to output a JavaScript code from the server (after you call the update code) that would call the function which will close the window.
More information on the subject is available in this blog post:
http://blogs.telerik.com/supportdept/posts/09-05-05/executing_javascript_function_from_server-side_code.aspx

All the best,
Georgi Tunev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Window
Asked by
Mark DeMichele
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Lester
Top achievements
Rank 1
Georgi Tunev
Telerik team
Charles
Top achievements
Rank 2
Share this question
or