-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: whizkid747
Message 1 in Discussion

 
Hi I was trying to convert an ASP.NET page to a word document. Everything works 
fine, but  
the viewstate(which is there in the rendered HTML,) variable (__VIEWSTATE) is 
getting  
displayed on the word document as a text box when I open the converted word 
document.  
This is the code I wrote. 
HttpContext.Current.Response<WBR>.Clear();
HttpContext.Current.Response<WBR>.Charset ="";
StringWriter stringWriter = new StringWriter();
Response.AddHeader("Content-Disposition", "attachment; filename=" 
+"newDoc.doc");
Response.ContentType = "application/msword";
HtmlTextWriter htmlTextWriter = new HtmlTextWriter(stringWriter); 
this.RenderControl(htmlTextWriter);
Response.Write(stringWriter.ToString());
Response.End(); 

I tried disabling the viewstate(EnableViewState=True) of all the controls, and 
the page  
itself. 
Then also the text box is being shown with no value inside it. 
Is there any method in which I can avoid the __VIEWSTATE variable not to appear 
in my  
document?
Also the created word document is showing "Top of Form" and "Bottom of Form" 
strings above  
and after the contents in the doc. How can I disable this?.


-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to