我开发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
发布评论