A potentially dangerous request

mceclip0.png

Symptoms

When saving an event rule or other content in GpsGate Server containing HTML code.
You get A potentially dangerous Request.Form value was detected from the client error.

This issue affect users running .NET 4.0 as framework for the web application.
It also affects you running IIS Express since it only support version > 4.0

Fix

To fix this problem you need to add a few lines to the Web.config file Web.config if found in the IIS directory in GpsGateServer installation. 

By default, it is found here: c:\GpsGateServer\IIS\web.config

1. Open the web.config file using a text editor. e.g. Notepad.

2. Find this section:

<system.web>
    <httpModules>
      <add type="Franson.HttpModules.UrlRewriter" name="UrlRewriter" />
      <add type="Franson.Web.GZipHttpModule" name="GZipHttpModule" />
    </httpModules>
  </system.web>

Note, the <system.web> section might not look exactly as in this example.

3. Within the <system.web> section add:

<httpRuntime requestValidationMode="2.0"/>

The whole section should look like this now:

<system.web>
    <httpModules>
      <add type="Franson.HttpModules.UrlRewriter" name="UrlRewriter" />
      <add type="Franson.Web.GZipHttpModule" name="GZipHttpModule" />
    </httpModules>
    <httpRuntime requestValidationMode="2.0"/>
  </system.web>

4. Save the file.

For more info see:
http://msdn.microsoft.com/en-us/library/hh882339%28v=vs.110%29.aspx