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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -