How to invoke multiple JQuery function from .cs file?

Rajnilari2015
Posted by Rajnilari2015 under C# category on | Points: 40 | Views : 222
Suppose we have 4 JQuery function as "Function1()","Function2()","Function3()" and "Function4()".

Now we want to invoke those functions from the code behind.

We will provide two ways to do so


Way 1: Invoke via SriptManager.RegisterStartupScript by specifying unique unique name to each script block


SriptManager.RegisterStartupScript(this.Page, this.GetType(), "script1", "Function1();", true);

ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script2", "Function2();", true);

SriptManager.RegisterStartupScript(this.Page, this.GetType(), "script3", "Function3();", true);

ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script4", "Function4();", true);


Way 2: Invoke via SriptManager.RegisterStartupScript by specifying multiple javascript statements in once RegisterStartupScript

ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script","Function1();Function2();Function3();Function4();", true);


Hope this helps

Comments or Responses

Login to post response