Display a javascript alert in an ajax call

  • Thread starter Thread starter Jeremy
  • Start date Start date
J

Jeremy

I've got a button in an update panel. In the click event of the button
(server side code), I perform some logic and under certain criteria I want
to display an alert to the user. I've tried several things like adding an
onload javascript event to one of the controls in the update panel, and
I've tried adding a lteral control to the update panels
ContentTemplateContainer.Controls collection where the literal controls
contents where <script>alert('this is a test');</script> These don't work.
Is there a way to do this?
 
I saw something like "AJAX Advanced tips" in MSDN magazine (You can get it
online on msdn.microsoft.com )
And they described on how to do it.

UpdatePanel has methods like RegisterScript..... And you need to use it.

George.
 
use the ajax ScriptManager to register the client script or better yet,
register a client completion routine for the update panel, and check a
hidden field (in th panel) for status).

-- bruce (sqlwork.com)
 
Back
Top