Jun 21, 2014, 8:17 PM
[CLOSED] Fill controls from controller with model binding
I dont know surely,I am correct or wrong
VIEW CODE
CONTROLLER CODE
Is there any way to fill controls in view from controller using this technique.please let me know ,its very helpful for me
VIEW CODE
X.TextFieldFor(obj=>obj.State).AnchorHorizontal("100%")
.AllowBlank(false).LabelAlign(LabelAlign.Top).Width(250),
X.DisplayField().Flex(1).Html(" "),
X.TextFieldFor(obj=>obj.PinCode).AnchorHorizontal("100%")
.AllowBlank(false).LabelAlign(LabelAlign.Top).Width(250)
I have some controls like these and bind with model.CONTROLLER CODE
public ActionResult Edit(string selected)
{
SelectedRowCollection src = JSON.Deserialize<SelectedRowCollection>(selected);
Int64 lRecordID = 0;
foreach (SelectedRow row in src)
{
lRecordID = Convert.ToInt64(row.RecordID);
}
tbl_PM_ProjectInformation _tbl_PM_ProjectInformation = new tbl_PM_ProjectInformation();
_tbl_PM_ProjectInformation.ProjectID = lRecordID;
_tbl_PM_ProjectInformation = _ProjectInformation.pm_projectinformation_GetByProjectID(_tbl_PM_ProjectInformation);
//X.GetCmp<Hidden>("hdfProjectID").SetValue(Convert.ToInt64(_tbl_PM_ProjectInformation.ProjectID).ToString());
//X.GetCmp<TextField>("txtUOMName").Text = _tbl_Pur_MasterUOM.UOMName;
//X.GetCmp<TextField>("txtUOMType").Text = _tbl_Pur_MasterUOM.UOMType;
//X.GetCmp<TextField>("txtDescription").Text = _tbl_Pur_MasterUOM.Description;
X.GetCmp<Window>("Window1").Show();
return this.Direct(_tbl_PM_ProjectInformation);
}
tbl_PM_ProjectInformation is my model,here i fill object of tbl_PM_ProjectInformation and return with Direct.Is there any way to fill controls in view from controller using this technique.please let me know ,its very helpful for me
Last edited by Daniil; Jun 27, 2014 at 10:55 AM.
Reason: [CLOSED]