I have a page as follows:
<% using (Ajax.BeginForm("AddAnswer","Marketplace",new AjaxOptions() {HttpMethod = "POST" })){ %>
AddAnswer action adds some data to db. What I want to do is: when answer has been successfully added, append #answers div with the current answer passed to controller. When answer has not been successfully added to db – I would like to display appropriate error in #errors div. How can I do this?
Here’s what I can suggest:
Controller:
View: