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

How can I alert() a message during an AJAX request

2 Answers 262 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Michal
Top achievements
Rank 1
Michal asked on 22 Jun 2009, 11:35 AM
I am wondering what is the best practice to show the user an alert() box with a given message (from server side) during an AJAX request.

Here is an example: Let's say I have an event handler method for handling the drop of a row and the action is performed with AJAX. Now I discover on the server side that the drop is not legal (e.g. he is not allowed to drop a row onto some object) and I would like to show a simple javascript alert() box with "Sorry, you cant drop X on Y cause you have no permission."

The message comes from the server side as it reflects business rules. the best thing would be to throw an exception as this is displayed in an alert box but I cant do it in our app as exceptions are handled globally and posted to an exception log which is used in QA.

2 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 22 Jun 2009, 02:04 PM
Hello Michal,

You could use the Alert method of your AJAX control (RadAjaxManager, RadAjaxPanel)
Alert Method

Regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Michal
Top achievements
Rank 1
answered on 23 Jun 2009, 03:34 AM
you guys are just awesome! Thanks for your quick help.. it's exactly what I was looking for.....
Tags
Ajax
Asked by
Michal
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Michal
Top achievements
Rank 1
Share this question
or