Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I dont know surely,I am correct or wrong

VIEW CODE
[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)[/CODE]

I have some controls like these and bind with model.

CONTROLLER CODE


[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);
}[/CODE]

tbl_PM_ProjectInformation is my model,here i fill object of tbl_PM_ProjectInformation and return with Actionresult.

Is there any way to fill controls in view from controller using this technique.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900