Display a javascript alert in an ajax call

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?
 
G

George Ter-Saakov

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.
 
B

bruce barker

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top