我正试图在$("#ButtonA").click(function () {
处设置断点
在下面显示的代码中 - 但是在调试和单击按钮时它永远不会被击中,我不确定为什么。
P.S。
我对C#和JQUERY非常陌生 - 如果我忽略了一些简单的事情,我真的很抱歉。
@{
ViewBag.Title = "Index";
}
<asp:Label ID="lbltxt" runat="server">Click button when finished</asp:Label>
<button id="modal-opener">Click me</button>
<div id="dialog-modal" title="Title">
<p>Please enter your first name</p>
<input id="Input" type="text" />
<input id="ButtonA" type="button" value="Button A" />
<input id="ButtonB" type="button" value="Button B" />
<input id="ButtonC" type="button" value="Button C" />
</div>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>@ViewBag.Title</title>
@Styles.Render("~/Content/css")
<link href="~/Content/themes/base/jquery-ui.css" rel="stylesheet" />
@Scripts.Render("~/bundles/jquery")
<script src="~/Scripts/jquery-ui-1.8.24.min.js"></script>
@Scripts.Render("~/bundles/modernizr")
<script>
$(function () {
$("#dialog-modal").dialog({
autoOpen: false,
height: 200,
width: 520,
});
$("#modal-opener").click(function () {
$("#dialog-modal").dialog("open");
});
$("#ButtonA").click(function () {
$('#<%=lbltxt.ClientId%>').text('Hello World');
});
});
</script>
</head>
<body>
@RenderBody()
@RenderSection("scripts", required: false)
</body>
</html>