473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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
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?
Sep 18 '07 #1
3 3790
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******************@TK2MSFTNGP06.phx.gbl...
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?

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

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****************@TK2MSFTNGP02.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
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?

Sep 18 '07 #4

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

Similar topics

2
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...
6
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...
2
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...
6
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...
1
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: ...
8
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...
1
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...
3
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...
2
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...

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.