So here is my dilemma. I am making a rudimentary text area and i have some buttons to add bold, link, img, and italics.
When i don't insert any HTML in the text area, the method gets called properly and the breakpoint is hit. However, if I use HTML tags inside the text area the breakpoint doesn't even get called. through the following ajax controller:
@using (Ajax.BeginForm("CreatePost", "Accounts", new AjaxOptions
{
InsertionMode = InsertionMode.Replace,
HttpMethod = "POST",
LoadingElementId = "loading",
UpdateTargetId = "CreateMessage"
}))
{
@Html.AntiForgeryToken()
When I use html it fails to even trigger the method. Is there a way to allow tags to be read normally and still be able to call the method?
underlying method:
[HttpPost]
[ValidateAntiForgeryToken]
[AllowAnonymous]
public async Task<ActionResult> CreatePost(BlogViewModel blog, string returnUrl)
{
if (ModelState.IsValid)
{
try
{
await Task.Run(new Action( blog.CreatePost ) );
//blog.CreatePost();
if (blog.BlogID > 0)
{
ViewBag.Message = blog.Message;
}
else
{
ViewBag.Message = "Problem Posting new content";
}
}
catch (Exception ex)
{
ViewBag.Message = "Problem Posting Content: '" + ex.Message;
}
}
return PartialView("PopupMessage");
}//end CreatePost