Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2009-07-15
2
Medium Priority
?
567 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 2000 total points
ID: 24863611
Try this:

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

Open in new window

0
 

Author Closing Comment

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

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
The most up-to-date version of this article is on my Blog https://iconoun.com/blog/
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

885 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