Bespoke Applications – Building your own website

3. Modifications to the web.config

  1. Add web.config to the root folder of the project
  2. Add the following to the web.config to register data providers.
Copy
  <system.data>
  <DbProviderFactories>
  <add name="Npgsql Data Provider" invariant="Npgsql" support="FF" 
  description=".Net Framework Data Provider for Postgresql Server" 
  type="Npgsql.NpgsqlFactory, Npgsql" />
     <add name="SQLite Data Provider" invariant="System.Data.SQLite" 
description=".Net Framework Data Provider for SQLite" 
type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
    </DbProviderFactories>
 </system.data>
  1. Add connection string to web.config
Copy
<connectionStrings>
<add name="ConfigurationDatabase" 
connectionString="Data Source=&quot;
<path to db>\webMapLayersConfig.db&quot;
providerName="System.Data.SQLite" />
</connectionStrings>
  1. Replace <path to db> with the correct path for the config database. This is usually C:\inetpub\wwwroot\WebMapLayers8\App_Data\webMapLayersConfig.db
  1. Add the following to appSettings
Copy
<add key="Cadcorp.Web.UI.MapConfigConnector"
value="Cadcorp.Configuration.Connectors.SQLiteConfigConnector,
Cadcorp.Configuration" />
  1. Add to system.web
Copy
 <pages>
 <controls>
 <add tagPrefix="Cadcorp" namespace="Cadcorp.Web.UI.OpenLayers" assembly="Cadcorp.Web.UI" />
 </controls>
 </pages>
  1. Add required handlers by adding the following to the web.config
Copy
<system.webServer>
<handlers>
<add name="javascripthandler" verb="GET" path="JavascriptHandler.axd" type="Cadcorp.Web.UI.OpenLayers.JavascriptHandler,Cadcorp.Web.UI" />
<add name="proxyhandler" verb="GET,POST,PATCH,DELETE" path="proxy.axd" type="Cadcorp.Web.Proxy.Proxy,Cadcorp.Web.Proxy" />
</handlers>
</system.webServer>
4. Adding a map to Map.aspx