Sep 25, 2014, 6:16 PM
[CLOSED] RadioFor always False
I set up 3 radio buttons but never get true value for selected radio,please help.
View
View
@model ERP_test.Controllers.radiogroup
@{
var X=Html.X();
}
@X.ResourceManager()
@(X.FormPanel().ID("f")
.Items
(
X.FieldContainer().AnchorHorizontal("100%").Layout(LayoutType.HBox)
.Items
(
X.RadioFor(obj => obj.radio1)
.Name("PF")
,
X.RadioFor(obj => obj.radio2)
.Name("PF")
,
X.RadioFor(obj => obj.radio3)
.Name("PF")
)
)
.Buttons
(
X.Button()
.Text("Save")
.ID("btnSave")
.DirectEvents(de =>
{
de.Click.FormID = "f";
de.Click.Action = "save";
})
)
)
Controllerpublic class RadioForController : Controller
{
//
// GET: /RadioFor/
public ActionResult Index()
{
return View();
}
public void save(radiogroup _radiogroup)
{
}
}
public class radiogroup
{
public bool radio1 { get; set; }
public bool radio2 { get; set; }
public bool radio3 { get; set; }
}
Last edited by Daniil; Oct 03, 2014 at 1:42 PM.
Reason: [CLOSED]