473,763 Members | 2,930 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Display a javascript alert in an ajax call

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
ContentTemplate Container.Contr ols 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?
Sep 18 '07 #1
3 3806
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.
"Jeremy" <no****@please. comwrote in message
news:%2******** **********@TK2M SFTNGP06.phx.gb l...
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
ContentTemplate Container.Contr ols 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?

Sep 18 '07 #2
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)

Jeremy wrote:
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
ContentTemplate Container.Contr ols 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?

Sep 18 '07 #3
Thanks, I'm not familiar with client completion routine. What is this?

"bruce barker" <no****@nospam. comwrote in message
news:uw******** ********@TK2MSF TNGP02.phx.gbl. ..
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)

Jeremy wrote:
>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
ContentTemplat eContainer.Cont rols 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?

Sep 18 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2056
by: christopher.secord | last post by:
I would like have a little "loading..." tab not unlike the one that gmail uses and I would like to display that tab while an ajax call is made. The javascript to display the tab works. The javascript to hide the tab works. But when I put the two together inside the function that calls the ajax service, they don't work. What seems to happen is that calls to change DOM object properties are queued up, and then all executed...
6
2425
by: Trip | last post by:
Please if someone can help me !!! I need client and server code(principle based on AJAX) for next problem: i have 3 <select> tags on html page.(it must be NO page reload(callback) only select(controles) regeneration !!!) In the first <select> goes countries, which must be pulled from some kind of database (whichever you want). after that if i select some country, second <select> must be filled with regions of that country, and when i...
2
2147
by: sgmaat | last post by:
I have create a AJAX webpage where if you press a link content is loaded into a div. NOw when this content is loaded no javascript is processed (i.e <Script>alert(..);</script>), but if the javascript is in <a onclick="..."> it will work. What i would like to know is: - Is this normal - What do i need to change so that javascript does get processed? Thanks in advance, Stephan Maat
6
2932
by: KDCinfo | last post by:
Although I'm making an ajax call, this is really a javascript question (although it could be even more of an HTML or DOM question... not exactly sure) I'm doing an ajax call to a remote php file... it returns a value fine, and even enters a value into a text field on my form. The problem is, right after the function call to the ajax function, I do an alert of what the field value is, and it doesn't recognize the field value has been...
1
4953
by: Bob | last post by:
Hi, Hope you can help me with this one. I'm at my wits end. I'm trying to create an intelligent edit-box like the excellent "Customer" one at the URL: http://munich.schwarz-interactive.de/autocomplete.aspx
8
3216
by: Pratik Patel | last post by:
Hello, I used innerHTML to assign HTML content. but in my HTML page content have also some javascript function and it will run when page load. bu when HTML code assgin thru innerHTML then this javascript is not working. e.g. html content:
1
1709
by: kaj28121980 | last post by:
I have a typical senario. My Web component provides action for database backup and restore. while user wants to backup or restore database the user is logged out and redirected to the login page and the webserver (basically an application server JBoss) shuts down. In the login page there is an ajax call which checks when the server is again fully functional after the backup/restore is complete and server is restarted.after the server is ready...
3
3383
by: pablosuk78 | last post by:
Dear coders, I'm facing a problem and after few research I found that many ppl were looking around for the same solution, hope someone more expert than me could give a good help. I created an AJAX function that i.e. on click does a request to a server and show into a specified tag the results (well until here is something eveyone would do with AJAX)... the point is that the result is something like the this: i.e. <!-- this is the...
2
2450
by: gradinafrica | last post by:
I'm trying to create a log out button that uses AJAX to call a php file which ends the current session: //logout.php <?php if (!session_start()); session_destroy(); //Destroys the session echo "success"; ?>
0
9383
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10140
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9992
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9935
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8821
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3916
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3519
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.