Thursday 15 January 2015

c# - How to send data from view to controller on button click -


How can I do the operation of the controller and in the time to send, what value is selected in the drop down list Button is clicked? Here's an example that mine What does CSSM look like? This is just an example, generally I need to collect more data from the current view on time when the button is clicked.

  & lt; Body & gt; & Lt; Div & gt; @htmlpropdunlist ("name") & lt; Br / & gt; @htmlpropdunlist ("age") & lt; Br / & gt; @htmlpropdunlist ("gender") & lt; Br / & gt; @Usage (Html.BeginForm ("FindPerson", "MyController", FormMethod.Post)) {& lt; Input type = "submit" value = "search" /> } & Lt; / Div & gt; & Lt; / Body & gt;    

To submit to the data controller, the input should be visible within & Lt; Form & gt; tag.

For example:

  & lt; Body & gt; & Lt; Div & gt; @Using (HTML.bizform ("SearchPerson", "microcontroller", formmath.post)) {@ HTMLPropDown List ("name") & lt; Br / & gt; @htmlpropdunlist ("age") & lt; Br / & gt; @htmlpropdunlist ("gender") & lt; Br / & gt; & Lt; Input type = "submit" value = "find" /> } & Lt; / Div & gt; & Lt; / Body & gt;    

No comments:

Post a Comment