【发布时间】:2011-05-01 06:19:53
【问题描述】:
我想知道在 ASP.NET MVC 上使用 jQuery 会发生什么,任何 jQuery 代码在点击方法中都不能特别工作
我正在使用 Razor 视图引擎。
有关于这个问题的通知吗?
$(document).ready(function () {
$('.simpledialog').simpleDialog();
});
$('#button').click(function(){
//ToDo
});
我已经添加了对话脚本和 css :
<link href="/Content/Site.css" rel="stylesheet" type="text/css" />
<script src="../../Scripts/jquery-1.5.1.js" type="text/javascript"></script>
但是当点击按钮时它总是会中断并且我收到一个错误:
Microsoft JScript runtime error :
Object doesn't support property or method 'dialog'
【问题讨论】:
-
我们需要更多信息来帮助您,而不仅仅是“不工作”。你能添加一些代码吗?更新后的默认项目模板使用 jQuery 1.5.1 您是否引用 jquery-1.5.1.js 文件而不是旧的 jquery-1.4.2.js?
-
我正在尝试使用模态对话框,我添加了一些片段
-
确保simpledialog插件文件存在。
标签: jquery asp.net-mvc-3 razor