Sunday, February 6, 2011

Call a Javascript from your .Net code using C#

Sometimes we need to have to call a Javascript function from your C# code.
This is the code.

For using this code you need to import System.Cofiguration Namespace.

This particular code calls a message box from an asp.net code.

ScriptManager.RegisterStartupScript(this, this.GetType(), "Msg", "alert('Invalid UserName or Password');", true);