62,177
社区成员
发帖
与我相关
我的任务
分享
StringBuilder sb = new StringBuilder();
sb.Append("<table border='1'>");
foreach (DataRow dr in dt.Rows)
{
sb.Append("<tr>");
sb.Append("<td>"+ dr["column0"] +"</td>");
sb.Append("<td>"+ dr["column1"] +"</td>");
sb.Append("<td>"+ dr["column2"] +"</td>");
sb.Append("</tr>");
}
sb.Append("</table>");
Response.Write(sb.ToString());
public static string Build_msgtd(bool ctrl, string msg,string url)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("<table style='font-size:12px' width=\"500\" border=\"0\" bgcolor=\"#AECDE3\" align=\"center\" cellpadding=\"3\" cellspacing=\"1\">");
sb.Append("<tr >");
sb.Append("<td align='left' valign='top' bgcolor='#FFFFFF'>");
sb.Append("<table border='0' cellpadding='0' cellspacing='0' >");
sb.Append("<tr>");
sb.Append("<td width='20' align='left'><img src='/WebContainer/Image/icon_triangle.gif'/></td>");
sb.Append("<td style='font-size:14px' > <B>");
if (ctrl == true)
{
sb.Append("操作成功");
}
else
{
sb.Append("温馨提醒");
}
sb.Append("</B></td>");
sb.Append("</tr>");
sb.Append("</table>");
sb.Append("</td>");
sb.Append("</tr>");
sb.Append("<tr>");
sb.Append("<td align='center' bgcolor='#ffffff'>");
sb.Append("<table border='0' cellpadding='0' cellspacing='0'>");
sb.Append("<tr> ");
sb.Append("<td style='font-size:12px' align='center' height=100px>");
sb.Append(msg);
sb.Append("</td>");
sb.Append("</tr>");
sb.Append("</table>");
sb.Append("</td>");
sb.Append("</tr>");
sb.Append("<tr>");
sb.Append("<td align='center' bgcolor='#FFFFFF' border='0'/><a href='");
sb.Append(url);
sb.Append("'><img src='/WebContainer/Image/goback.gif' border=0></a>");
sb.Append("</tr>");
sb.Append("</table>");
sb.Append("</td>");
sb.Append("</tr>");
sb.Append("</table>");
return sb.ToString();
}
public static void build_exit(bool ctrl, string msg, string url)
{
HttpContext.Current.Response.Write(Build_msgtd(ctrl, msg, url));
HttpContext.Current.Response.End();
}
function ff()
{
var data=<%loaddata()%>
}
public string loaddata()
{
//返回一个字符串
return "[[1,2,3],[4,5,6]]";
}