Submit Partial View Data with main form in asp.net MVC -
Submit how I submit data to a partial view on the main view. Partial view does not have a separate submit button
I want to add multiple products to a single order. Each product is a partial view The user can add many products at the click of "plus sign". I want to submit all the products after submitting the order. See my place order
@model MyApp Models.Order_Detail #section scriptsection {& lt; Script src = "@ Url.Content (" ~ / scripts / jquery.validate.min.js ")" type = "text / javascript" & gt; & Lt; / Script & gt; & Lt; Script src = "@ Url.Content (" ~ / script / jquery.validate.unobtrusive.min.js ")" type = "text / javascript" & gt; & Lt; / Script & gt; & Lt; Script src = "../../ script / jquery-1.4.4.min.js" type = "text / javascript" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {$ ("AddProduct"). Live ("click", function () {$ .get ("AddProduct", function (data) {$ ("# product") Adidar (data); HIDX Minesbutton ();})}}; @using (HTML.jbject form) {@ html.ValidationSummary (true) gt; & lt; ; Legend >> Order & lt; div class = "editor-label" & gt; Customer & lt; / div & gt; & lt; div class = "editor-field" & gt; ; @ Html.DropDownListFor (c => c.Order.CustomerID, (list & lt; SelectListItem & gt;) & lt; div & gt; & lt; fieldet id = "product" & gt; & lt; legend & Gt; Products & lt; / Legend & gt; @ html.Partial ("AddProduct") & Lt; / fieldset & gt; & lt; div class = "editor-label" & gt; @htmllabelsfor (model = & gt; model.order orderdate) & lt; / Div> & lt; p & gt; & lt; input type = "submit" value = "create" />
Click the submit button How do I get all the products in my product?
[HTTP post] Public Actionier Place Order (order-delivery order) // Ord 't product included ?? {// Add order to see DB return ("success");
}
Take a look at this page, I suppose It will be able to assist you.
You can change your action method to
public anecdarcent place order (order-details order, products [])
or to bind the order-point model.
Comments
Post a Comment