c# - Passing values between MVC Views -
i need pass values selected these radioboxes "list" view
cshtml file
@html.radiobuttonfor(m => m.smokehouse, 1) @html.radiobuttonfor(m => m.smokehouse, 0) @html.radiobuttonfor(m => m.smokecar, 1) @html.radiobuttonfor(m => m.smokecar, 0) @html.radiobuttonfor(m => m.smokework, 1) @html.radiobuttonfor(m => m.smokework, 0) [httppost] public viewresult smokingenvironments() { return view("list"); }
class
public class screen { public int smokecar { get; set; } public int smokehouse { get; set; } public int smokework { get; set; } }
assuming have submit button posts action, need update controller take model parameter , pass next view:
[httppost] public viewresult smokingenvironments(screen model) { return view("list", model); }
Comments
Post a Comment