jquery - When to use html.beginform vs ajax.beginform -
it's amazing after posts i've checked there still no definitive explanation (in mind) in situation should subject data used...
i know html.beginform, perform postback, post data controller method, , either redirect method or return same view user.
i know ajax.beginform, you must (correct me if i'm wrong) specify updatetargetid resulting posted data controller method go partial view within div tag on same page form. know cannot redirect action method after form submitted.
under both these conditions, can still have user input round of data submit , process via controller.
so, unless need redirect action method, why wouldn't use ajax.beginform of time?
the thing can imagine, html.beginform method best suited data entry input on , on again whereas ajax.beginform method used display result user depending on information input form (almost one-time) deal. btw, know i've contradicted myself use of saying use ajax.beginform of time.
can please give me relatively simple explanation when each of these methods should used?
well said, ajax calls when need stay in same page, , used in single page applications. (like when submit answer here on stackoverflow, partial refresh page)
but want go view (page). (like if on site doing registration new user, after submit redirected home page)
Comments
Post a Comment