title: C# ASP.Net Errors on form submission
body: <p>I was hoping to get some insight on the error that are produced by the system. I am using a already built message system that I got some time ago and it works but sometimes on the forms I will get errors that I do not understand. For instance on a Create I have a <code>try / catch</code> block that produces a message if it has successfully Executed. I have tried to search for these errors in my project and it does not come up with anything. Even if it was in meta data a search should find it.
  I use <code>  System.Text.StringBuilder sb = new System.Text.StringBuilder();</code> for the message and the code looks like this:</p>
  <pre><code>    public ActionResult Create(Vendors model)
      {
          System.Text.StringBuilder sb = new System.Text.StringBuilder();
          try
          {
              if (ModelState.IsValid)
              {
                  var userId = User.Identity.GetUserId();
  
                  //var getdata = ExtendedViewModels.VendorToEntity(model);
                  model.VendorId = Guid.NewGuid();
                  model.CreatedDate = System.DateTime.Now;
                  model.CreatedBy = User.Identity.Name;
                  model.Status = true;
  
                  db.Vendors.Add(model);
                  db.SaveChanges();
               
                  sb.Append(&quot;Submitted&quot;);
                  return Content(sb.ToString());
              }
              else
              {
                  foreach (var key in this.ViewData.ModelState.Keys)
                  {
                      foreach (var err in this.ViewData.ModelState[key].Errors)
                      {
                          sb.Append(err.ErrorMessage + &quot;&lt;br/&gt;&quot;);
                      }
                  }
              }
          }
          catch (Exception ex)
          {
              sb.Append(&quot;Error :&quot; + ex.Message);
          }
          return Content(sb.ToString());
      }
  </code></pre>
  <p>When this returns or closes the <code>Modal</code> it produces a message or if there is an error it will produce that so you can fix it like a Required field. If everything is okay it will produce from this:</p>
  <pre><code>@Html.StarkAjaxFormSubmiter(&quot;frmVendors&quot;, &quot;tbVendors&quot;, true, &quot;Action Successfully Executed&quot;)
  </code></pre>
  <p>This is a green box that shows up as &quot;Action Successfully Executed&quot;. If something is wrong a red box shows up and you get a message. In my case I am getting a red box that says <code>Submitted Read Warnings Alerts</code> This is how it is spelled. I doubt this is a error that comes from ASP.Net it looks more like a custom message, I dont know what it means and I cannot find it anywhere. Regardless, it does create the record in the db. The other error I have gotten shows <code>Something is went wrong [object, object]</code> Not only do I want to find out what these mean, I also want to clean them up and give a proper message that makes sense. Does anyone have any ideas as to how to correct this? Could they be encypted in the custom package that was written for this? That is why I cannot find them. I have also viewed the package and did not find anything for this.</p>
  <p>This is from Meta data:</p>
  <pre><code>        //
      // Parameters:
      //   stark:
      //
      //   FormId:
      //     Enter Here Form ID LIKE So you have to pass = frmCreate
      //
      //   DataTableId:
      //     Which DataTable You have update after submit provide that ID
      //
      //   IsCloseAfterSubmit:
      //     Do you want to opened popup close after submit , So pass=true or false any
      //
      //   SuccessMessage:
      //     Give any Success message
      public static MvcHtmlString StarkAjaxFormSubmiter(this HtmlHelper stark, string FormId, string DataTableId, bool IsCloseAfterSubmit, string SuccessMessage);
      //
      // Parameters:
      //   stark:
      //
      //   FormId:
      //     Enter Here Form ID LIKE So you have to pass = frmCreate
      //
      //   DataTableId:
      //     Which DataTable You have update after submit provide that ID
      //
      //   IsCloseAfterSubmit:
      //     Do you want to opened popup close after submit , So pass=true or false any
      //
      //   SuccessMessage:
      //     Give any Success message
      //
      //   AfterSuccessCode:
      //     Add other JQuery code if you want
      public static MvcHtmlString StarkAjaxFormSubmiter(this HtmlHelper stark, string FormId, string DataTableId, bool IsCloseAfterSubmit, string SuccessMessage, string AfterSuccessCode);
  </code></pre>
  <p>Thanks for our help</p>
  <p>UPDATE:
  I did some searching on the web and found a program called JetBrains dotPeek. I decompiled the dll and sure enough the messages are in there. So I should be able to change them and recompile it and add if I want, to it.</p>