c# - 在服务器端 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
}
}
解决方案
推荐阅读
- android - Android.mk 中的 WebRTC
- javascript - 浏览器后退按钮与我之前离开的滚动高度相同
- mapbox - Mapbox:查找具有定义半径的 POI
- c# - 如何在类中动态设置属性?
- c# - 将类设为私有,因此值不会被修改
- sql-server - DML 触发器,在插入/更新/删除后为多个客户创建新行
- java - 坚持通过 Firebase 获取名称
- elasticsearch - 如何按月划分响应并在 Elasticsearch 中使用 Java API 添加计数器
- python - 如何解决 gmsh Mesh 生成错误
- unit-testing - 在 Windows 应用程序容器中执行单元测试