Loading an XHTML Document from a File
In This Topic
You can load an XHTML document into the C1Editor using the LoadXml method.
- In the Visual Studio Solution Explorer, right-click the project name, select New Folder, and name it Xhtml.
- Place the XHTML document you would like to load into this folder. For this example, we will use a document named "galaxy.htm".
- Click the View menu and select Code to switch to Source view, if necessary.
- Add the following statements to your project.
To write code in Visual Basic
Visual Basic |
Copy Code |
Imports C1.Win.C1Editor
Imports System.IO
|
To write code in C#
C# |
Copy Code |
using C1.Win.C1Editor;
using System.IO;
|
- 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.
To write code in Visual Basic
Visual Basic |
Copy Code |
C1Editor1.LoadXml("C:\galaxy.htm")
|
To write code in C#
C# |
Copy Code |
c1Editor1.LoadXml(@"C:\galaxy.htm");
|
- Run the project and the C1Editor will show your XHTML document.