实现弹出窗口选人员,并将选的值返给CtrFlowH_NAME控件:
<script language="javascript">
function SelectReceiver(obj)
{
var value = window.showModalDialog("sperson.aspx","","dialogWidth=400px;
{
var value = window.showModalDialog("sperson.aspx","","dialogWidth=400px;
dialogHeight=300px;status=no; help=no;scroll=auto;resizable=no") ;
if(value!=null)
{
document.all.<%=CtrFlowH_NAME.ClientID%>.value=value;
}
}
</script>
if(value!=null)
{
document.all.<%=CtrFlowH_NAME.ClientID%>.value=value;
}
}
</script>
弹出页面的处理部分
protected void dgData_ItemCommand(object source, DataGridCommandEventArgs e)
{
if (e.CommandName == "select")
{
StringBuilder sbText = new StringBuilder();
sbText.Append("<script>");
sbText.Append("var arr;");
{
if (e.CommandName == "select")
{
StringBuilder sbText = new StringBuilder();
sbText.Append("<script>");
sbText.Append("var arr;");
// 标题(中文)
sbText.Append("arr='" + e.Item.Cells[3].Text.Trim().Replace(" ", "") + "';"); //用户名称
sbText.Append("window.parent.returnValue = arr;");
// 关闭窗口
sbText.Append("top.close();");
sbText.Append("</script>");
// 向客户端发送
Page.RegisterStartupScript(DateTime.Now.ToString(), sbText.ToString());
Response.Write(sbText.ToString());
sbText.Append("arr='" + e.Item.Cells[3].Text.Trim().Replace(" ", "") + "';"); //用户名称
sbText.Append("window.parent.returnValue = arr;");
// 关闭窗口
sbText.Append("top.close();");
sbText.Append("</script>");
// 向客户端发送
Page.RegisterStartupScript(DateTime.Now.ToString(), sbText.ToString());
Response.Write(sbText.ToString());
}
}
}