调用c#的cs文件上的jquery确认框

本文关键字:jquery 确认 文件 cs 调用 | 更新日期: 2023-09-27 18:23:48

下面是我的jQuery代码:

<meta charset="utf-8">
<title>jQuery UI Dialog - Modal confirmation</title>
<link href="Styles/jquery.ui.all.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css"/>
<script src="Scripts/jquery-1.6.2.js" type="text/javascript"></script>
<script src="Scripts/jquery.bgiframe-2.1.2.js" type="text/javascript"></script>
<script src="Scripts/jquery.ui.core.js" type="text/javascript"></script>
<script src="Scripts/jquery.ui.widget.js" type="text/javascript"></script>
<script src="Scripts/jquery.ui.mouse.js" type="text/javascript"></script>
<script src="Scripts/jquery.ui.button.js" type="text/javascript"></script>
<script src="Scripts/jquery.ui.dialog.js" type="text/javascript"></script>
<script src="Scripts/jquery.ui.draggable.js" type="text/javascript"></script>
<script src="Scripts/jquery.ui.position.js" type="text/javascript"></script>
<link href="Styles/demos.css" rel="stylesheet" type="text/css" />
<script>
    $(function () {
        $("#dialog:ui-dialog").dialog("destroy");
        $("#btnprnt").dialog({
            resizable: false,
            height: 140,
            modal: true,
            buttons: {
                "Yes": function () {
                    $(this).dialog("close");
                },
                No: function () {
                    $(this).dialog("close");
                }
            }
        });
    });
</script>

这是我的按钮点击事件:

protected void btnprnt_Click(object sender, EventArgs e)
{
    //Response.Redirect("Print.aspx");
    ScriptManager.RegisterClientScriptBlock(this, this.GetType  (), "NewWindow", "function();", true);
}

我的按钮在ajax面板中。我正在代码背后调用jquery函数。但是这个按钮点击不会触发jquery。

调用c#的cs文件上的jquery确认框

试试这个jquery插件。http://nadiana.com/jquery-confirm-plugin