View Single Post
  #1 (permalink)  
Old August 20th, 2010, 07:05 PM
Gayathri79 Gayathri79 is offline
Authorized User
Join Date: Mar 2010
Posts: 65
Thanks: 6
Thanked 0 Times in 0 Posts
Default Error with javascript Alert message in ASP server side code

I want to display a error message in a Message box in C#. So i tried the following :

Page.RegisterStartupScript("ScriptDescription", "<script type=\"text/javascript\"> alert('Please Enter a valid Comments');</script>");

-Sometimes the alert message is popping out and sometimes its not popping.

-Sometimes after it popps out, after i close the browser window, it gives me the following error:

"Microsoft Jscript Runtime Error:
Handler was not added through the SYS.UI.DOMEVENT.ADDHANDLER method."

-can anyone explain what went wrong?