This example will help you integrate ONLYOFFICE Docs into your web application written in .Net (C#) or .Net (C# MVC).
Please keep in mind the following security aspects when you are using test examples:
Download and install ONLYOFFICE Docs (packaged as Document Server).
Download the .Net (C#) or .Net (C# MVC) 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.
Check that your system meets the requirements:
Configure the IIS components for the server to work correctly:
Open Windows features:
Start -> Control Panel -> Programs -> Programs and Features -> Turn Windows features on or off
In the opened window, find Internet Information Services and check all the features that are chosen in the following image:
Run the Internet Information Service (IIS) Manager:
Start -> Control Panel -> System and Security -> Administrative Tools -> Internet Information Services (IIS) Manager
Add your website in the IIS Manager.
On the Connections panel right-click the Sites node in the tree, then click Add Website.
In the Add Website dialog box specify the name of the folder with the .Net (C#) / .Net (C# MVC) project in the Site name box.
Specify the path to the folder with your project in the Physical Path box.
Specify the unique value used only for this website in the Port box.
Check for the .NET platform version specified in IIS Manager for you website. Choose v4.0. version.
Application Pools -> right-click the platform name -> Set application Pool defaults -> .NET CLR version
Browse your website with the IIS Manager:
Right-click the site -> Manage Website -> Browse
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.