Solved

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

Posted on 2009-07-15
2
543 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 22

Accepted Solution

by:
prairiedog earned 500 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
The most up-to-date version of this article is on my Blog https://iconoun.com/blog/
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

752 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