在MVC Page

编程入门 行业动态 更新时间:2024-10-28 04:26:03
本文介绍了在MVC Page_Load事件中调用一个函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我开发MVC应用程序。我想打电话给在页面的页面加载事件JavaScript函数。另外我想一些字符串参数传递给这个函数,我想显示为证实消息的内容。在确认的确定一下,我想显示警报。我怎样才能做到这一点?

I am developing an MVC application. I want to call a javascript function on page load event of a page. Also I want to pass some string parameters to this function which i want to show as confirm message content. On confirm's OK click, i want to show an alert. How can i do this?

谢谢,卡皮尔

Thanks, Kapil

推荐答案

如果你正在考虑传统的ASP.NET服务器端的Page_Load事件然后忘掉它。而使用像jQuery和有一个js函数执行客户端。你可以要直接给JS的PARAMS通过。

If you're thinking about traditional ASP.NET server side Page_Load events then forget about it. Rather use something like jQuery and have a js function execute client side. You can pass in the params you want directly to the js.

更多推荐

在MVC Page

本文发布于:2023-11-10 15:36:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1575765.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:MVC   Page

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!