How to Display a Word Document in ASP.NET

Written by christopher hanson
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Display a Word Document in ASP.NET
ASP.NET enables Web programmers to access Microsoft Word documents. (ICHIRO/Stockbyte/Getty Images)

ASP.NET is a Web programming language used to create Web applications. The language was developed by Microsoft and is useful when working with Microsoft Office files such as Microsoft Word documents. ASP.NET can open and display Word documents on a web site by use of an iFrame. The method requires only two lines of code.

Skill level:
Moderate

Other People Are Reading

Instructions

  1. 1

    Launch a code editor or Notepad. Click "Start," "All Programs," "Accessories" and "Notepad."

  2. 2

    Save the file with the aspx extension. Click "File" and "Save As." Navigate to the save directory, then type a file name followed by ".aspx."

  3. 3

    Create an iFrame tag. Type:

    <iframe id="frmWord" runat="server" style="height: 1200px; width: 800px;"></iframe>

    Then, press "Enter."

  4. 4

    Put the following code at the top of the file:

    Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)

       frmWord.Attributes["src"] = http://localhost/MyApp/resume.doc;
    

    End Sub

  5. 5

    Save the file. Click "File" and "Save."

Don't Miss

Filter:
  • All types
  • Articles
  • Slideshows
  • Videos
Sort:
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the eHow.co.uk site, you consent to the use of cookies. For more information, please see our Cookie policy.