Why does Ajax.BeginForm redirect my page to a new blank page after submission?
My controller code:
[HttpPost]
public void ProductCommentAdd(int productId, string text)
{
}
Mvc ajax call in view:
@using (Ajax.BeginForm("ProductCommentAdd", "Shop", new AjaxOptions() { HttpMethod = "POST"}))
{
<input type="hidden" value="@Model.ProductId" name="ProductId"/>
<textarea name="text"></textarea>
<input type="submit" value="Submit"
}
When I click the submit button, my page is redirected to a new blank page. How can i fix this?
source
share