Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get edited value in MVC
    primarykey
    data
    text
    <p>im new in MVC 1.</p> <p>In my project im assigning IList to model and using forloop im assigning to Textbox , dropdox etc... User can change the value as per there requirement. What i want, how i will get the value present on aspx page in the form of ILIST when user click on SAVE ALL button present at the top of the page.</p> <p>here are the code which im using for populating form.... </p> <pre><code>&lt;asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server"&gt; &lt;% using (Html.BeginForm("MyController", "EditCopyRestaurantMealRate", FormMethod.Post, new { id = "frmEditCopyRestaurantMealRate" })) { %&gt; &lt;%= Html.Submit("Save All Services", ApplicationPermissions.ManageContract, new { name = "submitButton" })%&gt; &lt;table width="100%" class="edit_restaurant_form"&gt; &lt;col width="19%" /&gt; &lt;col width="30%" /&gt; &lt;col width="19%" /&gt; &lt;col width="*" /&gt; foreach (var item in Model) { %&gt; &lt;tr&gt; &lt;th&gt; &lt;label for="DateFrom"&gt; Effective from:&lt;/label&gt;&amp;nbsp;&lt;label class="mandatory"&gt;*&amp;nbsp;&lt;/label&gt; &lt;/th&gt; &lt;td&gt; &lt;% string dtFrom = ""; dtFrom = item.Datefrom.ToString("dd-MMM-yyyy"); %&gt; &lt;%= Html.TextBox("DateFrom", dtFrom)%&gt; &lt;/td&gt; &lt;th&gt; &lt;label for="DateTo"&gt; Effective to:&lt;/label&gt;&amp;nbsp;&lt;label class="mandatory"&gt;*&amp;nbsp;&lt;/label&gt; &lt;/th&gt; &lt;td&gt; &lt;% string dtTo = ""; dtTo = item.Dateto.ToString("dd-MMM-yyyy"); %&gt; &lt;%= Html.TextBox("DateTo", dtTo)%&gt; &lt;/td&gt; &lt;/tr&gt; &lt;% } %&gt; </code></pre> <p>here is the controller code. </p> <pre><code>public ActionResult MyController(string submitButton, IList&lt;CMS.Model.VcmsRestaurant&gt; AddendumMealRates) { // Need to receiv all value in list which is edited return View(@"~\index.aspx", AddendumMealRates); } </code></pre> <p>How I will get the the value in <code>MyController</code> which user will edited on the page?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload