string msg = "ccccccccccccc";
byte[] fileBuffer = new byte[8000];
char[] ch = msg.ToCharArray();
fileBuffer = System.Text.Encoding.Default.GetBytes(ch);
Context.Response.ContentType = "application/vnd.ms-excel";
Context.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("hello.xls", System.Text.Encoding.UTF8));
Context.Response.BinaryWrite(fileBuffer);
Context.Response.End();
Context.Response.Close();
byte[] fileBuffer = new byte[8000];
char[] ch = msg.ToCharArray();
fileBuffer = System.Text.Encoding.Default.GetBytes(ch);
Context.Response.ContentType = "application/vnd.ms-excel";
Context.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("hello.xls", System.Text.Encoding.UTF8));
Context.Response.BinaryWrite(fileBuffer);
Context.Response.End();
Context.Response.Close();