i have a form created with some textboxes and dropdown lists, they are updated dinamically using jquery, some of the values that i update, i push them in some labels, because i don’t want that the user modify them. i need those values but i don’t know how to take them and push into an object that i created.
i don’t know if i made myself clear. this is and example of my code
Pedidos miDetalle = new Pedidos(); //<= object
miDetalle.codTipoArt = Request.Form["ddTipoArticulo"]; // <= value from dropdown list
miDetalle.clave1 = Request.Form["tbClave1"]; // <= value from textbox
miDetalle.nombreArticulo = Request["#lbNombreTela"]; // <= how i'm trying to get the value
Inside your controller action you could get only values that were part of the POST. And only values of input fields will be sent to the server. So you could use hidden fields to store those values on the client. You cannot store those values in some labels and expect those values to be sent to the server when the form is submitted. So using jQuery instead of setting the values in labels you need to put them in addition in hidden fields with specific names and on the server you will be able to fetch those values using
Request["MyHiddenFieldName"]or even better using a view model.