0

In webforms i used to do this

Page.ClientScript.RegisterStartupScript(this.GetType(),"CallMyFunction","MyFunction()",true);

on mvc 5 how am i supposed to do this? I want to show a notification for example after something is inserted or updated in database

example i I have a controller

public class RecordsController : Controller
{
    public ActionResult Post()   
    {

        // Insert record in database and return rows modified
        // Show notification

    }
}
Jackal
  • 3,359
  • 4
  • 33
  • 78
  • 2
    You include a script block in the view that you return from the action, in one way or another (directly in the body of the view, referenced with a script tag from the view, referenced with a script tag from a layout etc.) – GSerg Apr 13 '19 at 17:32
  • could you show me an example of this? if its not asking much – Jackal Apr 13 '19 at 17:42
  • Possible duplicate of [What is the difference between client-side and server-side programming?](https://stackoverflow.com/questions/13840429/what-is-the-difference-between-client-side-and-server-side-programming) – Progman Apr 13 '19 at 18:21

0 Answers0