Here Mudassar Ahmed Khan has explained with an example, how to implement feature similar to the RegisterStartupScript and RegisterClientScriptBlock functions of ClientScript and ScriptManager classes of ASP.Net Web Forms in ASP.Net MVC.
The RegisterStartupScript and RegisterClientScriptBlock functions are used to call JavaScript function from Server Side methods.
Unfortunately in MVC, there is no such function and hence it needs to be implemented with the help of ViewBag object.
↧