0
我在Asp.Net VS08 C#上工作。點擊按鈕想要顯示彈出。彈出包含一個按鈕,點擊按鈕執行serverside事件但彈出不關閉,彈出關閉只點擊取消按鈕。 我的問題是。我可以調用彈出窗口,但點擊按鈕不執行服務器端事件。JQuery彈出問題
.aspx的代碼
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Popup3.aspx.cs" Inherits="Jquery1._8Version.Popup3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<link type="text/css" href="css/ui-lightness/jquery-ui-1.8rc2.custom.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8rc2.custom.min.js"></script>
<script type="text/javascript">
function openModalDiv(divname) {
$("#Popup").dialog({
bgiframe: true,
autoOpen: false,
height: 300,
modal: true,
buttons: {
Cancel: function() {
$(this).dialog("close");
}
},
close: function() {
allFields.val("").removeClass("ui-state-error");
}
});
$("#Popup").dialog("open");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div id="Popup" style="display: none;" title="Basic dialog">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button2" runat="server" Text="Button" onclick="Button2_Click" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
<input id="Button3" type="button" value="Open 1" onclick="javascript:openModalDiv('Popup');" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</form>
</body>
</html>
C#代碼:
protected void Button2_Click(object sender, EventArgs e)
{
Label1.Text = DateTime.Now.ToString();
}
謝謝。真的是工作,如何解決pinp的zindex,我想顯示彈出下面的按鈕。如何設置位置?在此先感謝 – user280048 2010-03-01 04:16:01