Syntax :
ScriptManager.RegisterStartupScript(Control control,type type,string Key,string Script,bool addScriptTags)
Example:
string s = "alert('Hello')";
ScriptManager.RegisterStartupScript(this, this.GetType(), "Hello", s, true);
If you give the script tag in the string s then give addScriptTags to false.
ScriptManager is a class inside System.Web.UI
As a result a alert box with 'hello' pops up, where you place this line.
To write a Script in server side in Asp.net
Posted by
Geeks
Labels:
Asp.net,
Javascript
Subscribe to:
Post Comments (Atom)
Post a Comment