# Loading an XHTML Document from a File

Learn how to load an XHTML document in the C1Editor control using the LoadXml method.

## Content



You can load an XHTML document into the [C1Editor](/componentone/api/win/online-richtexteditor/dotnet-framework-api/C1.Win.C1Editor.4.8/C1.Win.C1Editor.C1Editor.html) using the [LoadXml](/componentone/api/win/online-richtexteditor/dotnet-framework-api/C1.Win.C1Editor.4.8/C1.Win.C1Editor.C1Editor.LoadXml.html) method.

1.  In the Visual Studio Solution Explorer, right-click the project name, select **New Folder**, and name it **Xhtml**.
2.  Place the XHTML document you would like to load into this folder. For this example, we will use a document named "galaxy.htm".
3.  Click the **View** menu and select **Code** to switch to **Source** view, if necessary.
4.  Add the following statements to your project.
    
    DOC-DETAILS-TAG-OPEN
    
    DOC-SUMMARY-TAG-OPEN
    
    To write code in Visual Basic
    
    DOC-SUMMARY-TAG-CLOSE
    
    ```vbnet
    Imports C1.Win.C1Editor
    Imports System.IO
    ```
    
    DOC-DETAILS-TAG-CLOSE
    
    DOC-DETAILS-TAG-OPEN
    
    DOC-SUMMARY-TAG-OPEN
    
    To write code in C#
    
    DOC-SUMMARY-TAG-CLOSE
    
    ```csharp
    using C1.Win.C1Editor;
    using System.IO;
    ```
    
    DOC-DETAILS-TAG-CLOSE
    
5.  Add the following code to the **Page\_Load** event. This code uses the LoadXml method to load your XHTML document into the C1Editor. You will need to update the file path to the location of the XHTML document on your machine.
    
    DOC-DETAILS-TAG-OPEN
    
    DOC-SUMMARY-TAG-OPEN
    
    To write code in Visual Basic
    
    DOC-SUMMARY-TAG-CLOSE
    
    ```vbnet
    C1Editor1.LoadXml("C:\galaxy.htm")
    ```
    
    DOC-DETAILS-TAG-CLOSE
    
    DOC-DETAILS-TAG-OPEN
    
    DOC-SUMMARY-TAG-OPEN
    
    To write code in C#
    
    DOC-SUMMARY-TAG-CLOSE
    
    ```csharp
    c1Editor1.LoadXml(@"C:\galaxy.htm");
    ```
    
    DOC-DETAILS-TAG-CLOSE
    
6.  Run the project and the C1Editor will show your XHTML document.