Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. MVC - request denied where the query string is too long - RESOLVED

MVC - request denied where the query string is too long - RESOLVED

Scheduled Pinned Locked Moved ASP.NET
asp-netdatabasejavascripthtmlcom
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Andy_L_J
    wrote on last edited by
    #1

    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>
    
    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups