Aug 28, 2014, 7:56 AM
[CLOSED] Loop through fields inside FormPanel in controller
I have a design like bellow
how do I do this?
@(X.FormPanel().Layout(LayoutType.HBox).ID("f").Layout(LayoutType.VBox)
.Items
(
X.TextField()
.ID("f1")
.FieldLabel("f1")
,
X.NumberField()
.ID("f2")
.FieldLabel("f2")
, X.NumberField()
.ID("f3")
.FieldLabel("f3")
,
X.NumberField()
.ID("f4")
.FieldLabel("f4")
// ,
)
)
I want to get all fields inside frompanel and loop through,butpublic ActionResult Index()
{
var f = X.GetCmp<FormPanel>("f").Items;
return View();
}
but f count is always 0.how do I do this?
Last edited by matrixwebtech; Nov 05, 2014 at 12:07 PM.