Master.aspx
<script language="javascript">
function cwin()
{
var action = window.confirm("are you sure delete?");
if(action)
{
URL="ModalDialogForm.aspx";
var returnValue = window.showModalDialog(URL,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:320px;dialogHeight:300px;");
if(returnValue != null)
{
document.all("hidvalue").value = returnValue;
return true;
}
else
return false;
}
else
return false;
}
</script>
<base target="_self" />
ModalDialogForm.aspx
<base target="_self"/>
<script language="javascript">
function cwin()
{
var action = window.confirm("are you sure delete?");
if(action)
{
URL="ModalDialogForm.aspx";
var returnValue = window.showModalDialog(URL,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:320px;dialogHeight:300px;");
if(returnValue != null)
{
document.all("hidvalue").value = returnValue;
return true;
}
else
return false;
}
else
return false;
}
</script>
<base target="_self" />
ModalDialogForm.aspx
<base target="_self"/>
protected void btnSubmit_Click(object sender, EventArgs e)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
string returnvalue = this.txtModalDialog.Text.Trim();
string mfstr = "<script>\n";
mfstr += "window.returnValue='" + returnvalue.Replace("'", "\'") + "'\n";
mfstr += "window.close()\n";
mfstr += "</script>\n";
if (!IsClientScriptBlockRegistered("mfscript"))
{
this.RegisterClientScriptBlock("mfscript", mfstr);
}
}

浙公网安备 33010602011771号