Copy Code code as follows: 
 
 
  
 
 protected void Btnexcel_click (object sender, EventArgs e) 
 
{ 
 
list<buflow.model.orderhistory> orderlist = dal. GetOrderList2 (""); 
 
string filename = "3g Traffic Network Age upgrade Schedule User table"; 
 
string name1 = filename; 
 
String bname = Common.MyRequest.GetBrowserName (). ToLower (); 
 
if (bname. Contains ("Firefox")) 
 
{ 
 
} 
 
else if (bname. Contains ("ie")) 
 
{ 
 
filename = httputility.urlencode (filename, System.Text.Encoding.UTF8); 
 
} 
 
Else 
 
{ 
 
filename = httputility.urlencode (filename, System.Text.Encoding.UTF8); 
 
} 
 
 
  
 HttpResponse resp = System.Web.HttpContext.Current.Response;
Resp. Charset = "Utf-8";
Resp. Clear ();
Resp. Appendheader ("Content-disposition", "attachment;filename=" + filename + ". xls");
Resp. ContentEncoding = System.Text.Encoding.UTF8;
Resp. ContentType = "Application/ms-excel";
String style = "<meta http-equiv=\" content-type\ "content=\" application/ms-excel; Charset=utf-8\ "/>" + "<style> table{font:9pt Tahoma, Verdana; Color: #000000;  Text-align:center;  Background-color: #8ECBE8; }.table Td{text-align:center;height:21px;background-color: #EFF6FF;  Table th{font:9pt Tahoma, Verdana; color: #000000; font-weight:bold; Background-color: #8ECBEA; height:25px; Text-align:center; padding-left:10px;} </style> ";
Resp. Write (style);
Resp. Write (exporttable (list));
Resp. Write ("<table class= ' table ' ><tr><th>" + "mobile" + "</th><th>" + "channel" + "</th><th > "+" Time "+" </th></tr> ");
Dbvideolist = (list<subshiyongmodel>) session["Dbvideolist"];
foreach (BUFlow.Model.orderhistory Model in orderlist)
{
Resp. Write ("<tr><td>" + Model.phone + "</td>");
Resp. Write ("<td>" + Model.qudao + "</td>");
Resp. Write ("<td>" + model.tm + "</td>");
Resp. Write ("</tr>");
}
Resp. Write ("<table>");
 
 
 Resp. Flush ();
Resp. End ();
}
  
 
 
  
  
Note that the coding problem, in the output, it is best to add the following statement: 
 
 
  
  Copy Code code as follows: 
 
 
  
 
  
  
<meta http-equiv= "Content-type" content= "application/ms-excel; charset=gb2312 "/>