2014-11-19 2 views
0
Response.ContentType = "application/word"; 
Response.AddHeader("content-disposition", "inline;filename=TestPage.doc"); 
Response.Cache.SetCacheability(HttpCacheability.NoCache); 
StringWriter sw = new StringWriter(); 
HtmlTextWriter hw = new HtmlTextWriter(sw); 
this.Page.RenderControl(hw); 
StringReader sr = new StringReader(sw.ToString()); 

Response.Write(sw); 
Response.End(); 
Response.Flush(); 

aspx 페이지를 단어 형식으로 변환하려고합니다. 내가 MS 워드 파일을 생성하면 대화 상자가 표시됩니다. 로드 중 문제가 발생했습니다. 누락 된 파일 : c : \ Content \ Site.cssaspx 페이지 콘텐츠를 MS Word 형식으로 변환

css 파일을로드 할 수없는 것 같습니다. 해결 방안은 무엇인가. 회신 해주십시오.

답변

0

시도 추가 다음 헤더 :

Response.AddHeader("Content-Type: application/vnd.ms-word"); Response.AddHeader("Expires: 0");Response.AddHeader("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 

감사