首页 > 解决方案 > 在服务器端 mvc 上调用 javascript 函数

问题描述

在网络表单中,我曾经这样做

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

在 mvc 5 上我应该怎么做?例如,我想在数据库中插入或更新某些内容后显示通知

例如我有一个控制器

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

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

    }
}

标签: c#asp.net-mvc-5

解决方案


推荐阅读