How to integrate online editors into your own website on .Net (C#)
This example will help you integrate ONLYOFFICE Docs into your web application written in .Net (C#).
The integration examples are used to demonstrate document editors functions and the ways to connect Document Server to your own application. DO NOT USE these examples on your own server without PROPER CODE MODIFICATIONS! If you enabled any of the test examples, disable it before going for production.
Important security info
Please keep in mind the following security aspects when you are using test examples:
Step 1. Install ONLYOFFICE Docs
Download and install ONLYOFFICE Docs (packaged as Document Server).
See the detailed guide to learn how to install Document Server for Windows, for Linux, or for Docker.
Step 2. Download the .Net (C#) code for the editors integration
Download the .Net (C#) example from our site.
To connect the editors to your website, specify the path to the editors installation and the path to the storage folder in the settings.config file:
<add key="storage-path" value=""/> <add key="files.docservice.url.site" value="https://documentserver/" />
where the documentserver is the name of the server with the ONLYOFFICE Document Server installed and the storage-path is the path where files will be created and stored. You can set an absolute path.
If you want to experiment with the editor configuration, modify the parameters in the DocEditor.aspx file.
Step 3. Install the prerequisites
Check that your system meets the requirements:
Configure the IIS components for the server to work correctly:
Step 4. Run your website with the editors
Step 5. Check accessibility
In case the example and Document Server are installed on different computers, make sure that your server with the example installed has access to the Document Server with the address which you specify instead of documentserver in the configuration files. Make sure that the Document Server in its turn has access to the server with the example installed with the address which you specify instead of example.com in the configuration files.
If you integrated the editors successfully the result should look like the demo preview on our site.