Mike Ozalas

Mike Ozalas

  • NA
  • 2
  • 0

WordInWeb Only Opens Document In Word Not In Browser

Apr 13 2010 11:37 PM
I am trying to load a word file into the browser with WordInWeb.  I select the file from a DropDownList, then it populates the FilePath.   When I do this, a message appears at the top of IE saying  "To Protect Your Security Internet Explorer blocked this site from downloading files to your computer". When I click to allow, it reloads the page, then I have to select he document again..  When I do that, it opens Word, not in the browser.  How do I get it to show in the browser instead of opening Word?  Here is the code I'm using:

this.wrdEditor.FilePath ="../Documents/" + this.ddlWordDocs.SelectedItem.Text;
TextWriter tw = TextWriter.Null;
HtmlTextWriter writer = new HtmlTextWriter(tw);
wrdEditor.RenderControl(writer);

Do I have to set the TextWriter to something?  The TextWriter is needed for the HtmlTextWriter.  I would think that that would have been explained somewhere if it were necessary.

Any help would be appreciated.

Thanks.