Friday, February 5, 2010

How to show a Javascript alert on a server event in c#.

Showing Javascript alert on a server event

Quick and easy way to show common messages to users like
"No Records Found" :)


protected void Page_Load(object sender, EventArgs e)

{
ShowMessage();
}

protected void ShowMessage()
{
ScriptManager.RegisterStartupScript(this, GetType(), "my_msg", "alert('My Message !');", true);
}