MVC - request denied where the query string is too long - RESOLVED
-
Apologies in advance for the long post. I am getting the following error in my MVC app: HTTP Error 404.15 - Not Found The request filtering module is configured to deny a request where the query string is too long. Here is my code:
public class MailHelper
{
public string To { get; set; }
public string From { get; set; }
public string Subject { get; set; }
public string Message { get; set; }
public string ImageUrl { get; set; }public MaiHelper() {} public bool IsValid() { return !(EmailDate == null) && !(string.IsNullOrEmpty(To)) && !(string.IsNullOrEmpty(From)) && !(string.IsNullOrEmpty(Subject)) && !(string.IsNullOrEmpty(Message)) && !(string.IsNullOrEmpty(BannerUrl)); }
}
// Mail Controller...
public ActionResult Index()
{
MailHelper mH = New MailHelper();
mH.EmailDate = DateTime.UtcNow;
mh.From = "some@adress.com";return View(mH);
}
I am using an external jQuery library
ckeditor
to get RTB functionality in my Razor page:./*Index.cshtml*/
@Model Controllers.MailHelper
@{
Layout = null;
}
...@using (Html.BeginForm("Send", "Mail", FormMethod.Get))
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)<fieldset> <legend>MailHelper</legend> <table style="width: 700px;"> <tr> <th>Date</th> <td>@Html.EditorFor(model => model.EmailDate) @Html.ValidationMessageFor(model => model.EmailDate)</td> </tr> <tr> <th>To</th> <td>@Html.EditorFor(model => model.To) @Html.ValidationMessageFor(model => model.To)</td> </tr> <tr> <th>From</th> <td>@Html.EditorFor(model => model.From) @Html.ValidationMessageFor(model => model.From)</td> </tr> <tr> <th>Subject</th> <td>@Html.EditorFor(model => model.Subject) @Html.ValidationMessageFor(model => model.Subject)</td> </tr> <tr> <th>To</th> <td>@Html.TextAreaFor(model => model.Message, new { @class = "ckeditor", @id = "text-details" }) @Html.ValidationMessageFor(model => model.Message)</td> </tr> <tr> <th>Banner Url</th>