使用jquery对话框来处理asp.net onclick

时间:2013-05-09 12:43:33

标签: jquery asp.net

我的asp.net sqldatareader:(Admin.aspx.cs)

   while(dr.read()){
   l += "<a onclick='hello(";
                l += dr["cID"].ToString();
                l += ");'>";
                l += "</a>";
   }

Javascript函数:(Admin.aspx)

    <script language="javascript" type="text/javascript">
    function hello(id)
    {
        window.open("webform1.aspx?id=" + id, "", "height=50,width=100,scrollbars=no,resizable=no,toolbars=no,status=no,menubar=no,location=no");
    }
</script>

WebForm1.aspx的

    <asp:Button ID="btn_ok" runat="server" onclick="btn_ok_Click" Text="Ok" />

我想在Admin.aspx中使用jquery对话框来处理Webform1.aspx的按钮onclick功能,而不是使用javascript窗口

    $(function () {
    $("#del-dialog").dialog({
    autoOpen: false,
    width: 300,
    height: 100,
    modal: true,
    close: function (event, ui) {
        location.reload(false);
    },
     buttons: {
        'Delete': function () {
            $(this).dialog('close'); 
             // delete function goes here
        },
        'Cancel': function () {
            $(this).dialog('close');
        }
    },
});

$(".icon-del").click(function (event) {
    event.preventDefault();
    $("#del-dialog").dialog("open");
});
    });

0 个答案:

没有答案