Monday, 2 November 2009

Send javascript alert to client from codebehind

This is definitely really useful. I (mostly) love ASP.NET!
ScriptManager.RegisterClientScriptBlock(Me, GetType(Page), "clientAlert", "alert('This is the alert text');", True)
or in C#:
ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "clientAlert", "alert('This is the alert text');", true)

No comments:

Post a Comment

Comments are moderated, so you'll have to wait a little bit before they appear!