jQuery UI을 사용하십시오. 그들은 훌륭한 모범을 보입니다. 나는 항상 대화를 사용한다.
소스를 볼 수 있으며 여기에는 그 예가 나와 있습니다.
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Dialog - Default functionality</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<script>
$(function() {
$("#dialog").dialog();
});
</script>
</head>
<body>
<div id="dialog" title="Basic dialog">
<p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
</body>
원하는대로 맞춤 설정할 수 있습니다. 이 방법을 보여주는 링크가 표시됩니다.
EDIT : 코드를 뒤에서 열고 싶으므로 jQuery를 보여주고 어떻게 뒤 코드에서 호출 할 수 있습니까? 나는 이것을 사용하여 이메일을 보낸다.
function sendEmail() {
$("#email").dialog({
modal: true,
width: 700,
buttons: {
"Send": function() {
var btn = document.getElementById("<%=lbSend.ClientID %>");
if (btn) btn.click();
$(this).dialog("close");
},
Cancel: function() {
$(this).dialog("close");
}
}
);
jQuery("#email").parent().appendTo(jQuery("form:first"));
};
다음 코드에서.
protected void btnEmail_Click(object sender, EventArgs e)
{
//this calls the jQuery function.
Page.ClientScript.RegisterStartupScript(this.GetType(), "Call my function", "sendEmail();", true);
}
asp.panel 조각을 사용자 정의 컨트롤, 즉 ascx 파일에 넣지 않는 한이 방법은 저의 측면에서 효과가 있습니다. 패널이 aspx 페이지에 있고 ModalPopupExtender를 사용하면 팝업이 잘 표시됩니다. 팝업을 사용하여 클라이언트 측에서 해고 할 수 있어야합니다. 사용자가 그리드의 삭제 버튼을 클릭하면 행이 영구적으로 삭제된다는 경고를 표시합니다. 마찬가지로 포스트 백 작업이 수행 될 때 코드에서 실행해야합니다. 즉 처리가 모두 완료되었다는 확인을 사용자에게 제공합니다. –
ASCX 사용자 정의 컨트롤에 넣을 수 있습니다. 그것을 속성으로 드러내기만하면됩니다. public ModalPopupExtender ThePopup {get; 개인 세트}'는 .ascx.cs 코드에 충분해야하며, 뒤에 .aspx.cs 코드는'MyUserControl.ThePopup.Show()'를 수행 할 수 있습니다. – mason