Solved

Can I call clientside popup alert programatically with ASP.NET?

Posted on 2009-07-15
2
511 Views
Last Modified: 2013-11-08
I want to display a popup box programatically in an asp.net timer event function.  I can't use the native msgbox function as it won't work on the live webserver so was thinking of calling a javascript function with an alert box.  The javacript function is already in place I just need to call it but I don't know how to do this from the serverside code without triggering an event.  Is there any way I can trigger a button click event or something programatically to call the javascript function?  Basically my timer tick function runs in the background and at the Tick event it should display the popup if certain conditions are met as outlined in the Tick function.

Any help appreciated.  Thanks.

P.S.  Response.Write("<script language='javascript'>alert('hello');</script>") doesn't work for me.
0
Comment
Question by:alankinane
2 Comments
 
LVL 22

Accepted Solution

by:
prairiedog earned 500 total points
Comment Utility
Try this:

ScriptManager.RegisterStartupScript(Me, Me.GetType(), "alertbox", "alert('Timer.');", True)

Open in new window

0
 

Author Closing Comment

by:alankinane
Comment Utility
Thank-you very much, it was as simple as that!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video discusses moving either the default database or any database to a new volume.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now