弹出对话框
1.
<head runat="server">
<title>无标题页</title>
<link href="../../MyCSS/Stylesheet1.css" rel="stylesheet" />
<script type="text/javascript">
function OpenEditWin(frmWin,width,height)
{
var me;
// 把父页面窗口对象当作参数传递到对话框中,以便对话框操纵父页自动刷新。
//me = window;
// 显示对话框。
window.showModalDialog(frmWin,'search','dialogWidth='+width +'px;dialogHeight='+height+'px;help:no;status:no')
}
</script>
</head>
2.
protected void Page_Load(object sender, EventArgs e)
{
//IBtn_ID.Attributes.Add("onclick", "javascript:OpenEditWin('MaterialBaseChangeSearch.aspx',540,400)");
}
//查询要更改的货号
protected void IBtn_ID_Click(object sender, ImageClickEventArgs e)
{//showModalDialog()或是showModelessDialog()
//1.首先读入Session
//2.然后从对话框中读出Session 关闭这个Session 模糊查询出所有的值.
//3.点确定后将所需的值放入Session中,并将此对话框关闭
//4.从Session中将值读到父页面中. 并将这个Session关闭.
//Response.Write("<script>showModelessDialog('MaterialBaseChangeSearch.aspx','example05','dialogWidth:50px;dialogHeight:40px;dialogLeft:200px;dialogTop:150px;center:yes;help:yes;resizable:yes;status:yes');</script>");
Session.Add("s_IBtnValues", "MaterialID");
Session.Add("s_MaterialID", TxtMaterialID.Text.Trim());
IBtn_ID.Attributes.Add("onclick", "javascript:OpenEditWin('MaterialBaseChangeSearch.aspx',540,400)");
}
3.{
//IBtn_ID.Attributes.Add("onclick", "javascript:OpenEditWin('MaterialBaseChangeSearch.aspx',540,400)");
}
//查询要更改的货号
protected void IBtn_ID_Click(object sender, ImageClickEventArgs e)
{//showModalDialog()或是showModelessDialog()
//1.首先读入Session
//2.然后从对话框中读出Session 关闭这个Session 模糊查询出所有的值.
//3.点确定后将所需的值放入Session中,并将此对话框关闭
//4.从Session中将值读到父页面中. 并将这个Session关闭.
//Response.Write("<script>showModelessDialog('MaterialBaseChangeSearch.aspx','example05','dialogWidth:50px;dialogHeight:40px;dialogLeft:200px;dialogTop:150px;center:yes;help:yes;resizable:yes;status:yes');</script>");
Session.Add("s_IBtnValues", "MaterialID");
Session.Add("s_MaterialID", TxtMaterialID.Text.Trim());
IBtn_ID.Attributes.Add("onclick", "javascript:OpenEditWin('MaterialBaseChangeSearch.aspx',540,400)");
}
<head runat="server">
<title>无标题页</title>
<base target="_self"/>
<link href="../../MyCSS/Stylesheet1.css" rel="stylesheet" type="text/css" />
</head>
4. 对话框名 MaterialBaseChangeSearch.aspx<title>无标题页</title>
<base target="_self"/>
<link href="../../MyCSS/Stylesheet1.css" rel="stylesheet" type="text/css" />
</head>