fl27.js
<a href="javascript:selectcustomer('<%# Eval("CName")%>','<%# Eval("CID")%>')">选择</a>
<script type="text/javascript">
function selectcustomer(name,cid) {
var win = art.dialog.open.origin;
$('#txtCustomerName', win.document).val(name);
$('#hidCustomerId', win.document).val(cid);
CloseDialog();
}
</script>
-------------
/// <summary> /// 得到样式和CSS的引用 /// </summary> /// <returns></returns> protected string GetStyleAndScript() { StringBuilder sb = new StringBuilder(); sb.Append("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n"); sb.Append(" <link href=\"/javascript/themes/default/style.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />\r\n"); sb.Append("<link href=\"/javascript/themes/css/core.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />\r\n"); sb.Append("<link href=\"" + Page.ResolveUrl("~/style/main.css") + "\" rel=\"stylesheet\" type=\"text/css\" />\r\n"); sb.Append("<script type=\"text/javascript\" src=\"" + Page.ResolveUrl("~/javascript/jquery-1.7.1-min.js") + "\"></script>\r\n"); sb.Append("<script type=\"text/javascript\" src=\"" + Page.ResolveUrl("~/javascript/wtui.js") + "\"></script>\r\n"); sb.Append("<script type=\"text/javascript\" src=\"" + Page.ResolveUrl("~/javascript/validform.js") + "\"></script>\r\n"); sb.Append("<script type=\"text/javascript\" src=\"" + Page.ResolveUrl("~/javascript/jquery.artDialog.source.js?skin=chrome") + "\"></script>\r\n"); sb.Append("<script type=\"text/javascript\" src=\"" + Page.ResolveUrl("~/javascript/iframeTools.js") + "\"></script>\r\n"); sb.Append("<script type=\"text/javascript\" src=\"" + Page.ResolveUrl("~/javascript/base.js") + "\"></script>\r\n"); sb.Append("<script type=\"text/javascript\" src=\"" + Page.ResolveUrl("~/javascript/uiiframe.js") + "\"></script>\r\n"); sb.Append("<!--[if IE]>\r\n"); sb.Append("<link href=\"/javascript/themes/css/ieHack.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\"/>\r\n"); sb.Append("<![endif]-->\r\n"); return sb.ToString(); } /// <summary> /// 提示并关闭对话框 /// </summary> /// <param name="strAlert">提示语</param> /// <param name="refresh">是否刷新</param> protected void CloseDialog(string strAlert, bool refresh) { Response.Write("<!DOCTYPE html PUBLIC\"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"); Response.Write("<html xmlns=\"http://www.w3.org/1999/xhtml\">"); Response.Write("<head><title>提示</title>"); Response.Write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />"); Response.Write(GetStyleAndScript()); if (!refresh) Response.Write("<script type=\"text/javascript\">$(function(){CloseDialog(\"" + strAlert + "\");})</script>"); else Response.Write("<script type=\"text/javascript\">$(function(){CloseDialogRf(\"" + strAlert + "\");})</script>"); Response.Write("</head>"); Response.Write("<body>"); Response.Write("</body>"); Response.Write("</html>"); Response.End(); }