.net - ASP NET MVC 3.0 GET USER INPUT -
whats best way user input view controller. mean specific input not "formcollection" someting "object person" or "int value" , how refresh page on interval
say example if view typed "person" class:
public class person { public string firstname { get; set; } public string lastname { get; set; } public int age { get; set; } }
then inside view:
@model mymvcapp.person @using(html.beginform()) { @html.editorformodel() // or html.textboxfor(m => m.firstname) .. , of properties. <input type="submit" value="submit" /> }
then you'd have action handle form:
[httppost] public actionresult edit(person model) { // stuff model here. }
mvc uses called modelbinders take form collection , map model.
to answer second question, can refresh page following javascript:
<script type="text/javascript"> // reload after 1 minute. settimeout(function () { window.location.reload(); }, 60000); </script>
Comments
Post a Comment