【发布时间】:2014-05-21 07:42:36
【问题描述】:
当用户在 asp.net 中单击带有用户控件的按钮时,我想制作一个弹出对话框,但由于对话框根本没有打开,我一直失败。 这是我的 .ascx 文件中的内容:
<div id="dialog" title="Basic dialog">
<p>some text here</p>
</div>
<script>
$(function () {
$("#dialog").dialog();
});
这是我的 .aspx 文件中的内容:
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js" type="text/javascript"> </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
<asp:Button ID="btnR" runat="server" Text="Requirements" CssClass="btn btn-info pull-right" />
</asp:Content>
我的母版页中有 jquery 1.11.0 min 那么我做错了什么,对话框没有弹出? 提前谢谢你
【问题讨论】:
-
我希望你已经关闭了
-
如果你想在按钮点击事件上打开对话框,你必须确保按钮不会触发返回 false 的回发以取消回发。
-
@Daniele94 :是的,我有......它只是发布时缺少的标签
-
@RandRandom : 我怎样才能使它成为 Ispostback?
-
你应该像这样防止回发stackoverflow.com/questions/683746/…
标签: c# javascript jquery asp.net