title: An exception of type 'System.InvalidOperationException' occurred in System.Web.Extensions.dll but was not handled in user code
body: <p>Why do have this error on this part of the code ?</p>
  
  <p>this part</p>
  
  <pre><code>           var data = serializer.Deserialize&lt;EmailTemplate&gt;(httpRequest.Form["data"].ToString());
  </code></pre>
  
  <p>my procedure</p>
  
  <pre><code>public int UpdateEmailTemplate()
      {
  
          HttpResponseMessage result = null;
          ObjectService uploadFile = new ObjectService();
          List&lt;ActiveUp.Net.Mail.Attachment&gt; attachment = new List&lt;ActiveUp.Net.Mail.Attachment&gt;();
  
          var httpRequest = HttpContext.Current.Request;
  
          if (httpRequest.Form["data"] != null)
          {
              var serializer = new JavaScriptSerializer();
              var data = serializer.Deserialize&lt;EmailTemplate&gt;(httpRequest.Form["data"].ToString());
  
              if (httpRequest.Files.Count &gt; 0)
              {
                  var docfiles = new List&lt;string&gt;();
                  foreach (string file in httpRequest.Files)
                  {
                      MemoryStream target = new MemoryStream();
                      httpRequest.Files[file].InputStream.CopyTo(target);
  
                      uploadFile.AddObject(data.Id, "SU_ENTITY_MSG_TEMPLATE","", target.GetBuffer(), httpRequest.Files[file].FileName);
                  }
              }
  
              AdminService List = new AdminService();
              return List.UpdateEmailTemplate(data);
      }
  </code></pre>
  
  <p>MY class</p>
  
  <pre><code>public class EmailTemplate
  {
     public int Id;
     public string TypeObject;
     public int? idObject;
     public string ObjectName;
     public string IdTeam;
     public string IdTask;
     public string Team;
     public string task;
     public string Title;
     public string Subject;
     public string dataHtml;
     public List&lt;Objects&gt; fileListRequest;
  }
  </code></pre>