i have class name MasterModel in which two different classes
1: MasterModel
2: departmentofficialsList
I want deptname from departmentofficialsList
in a view how can call departmentofficialsList class
but in a view MasterModel is using and i want Authority Name
in Model.DeptName
model PPAApplication.Models.ViewModel.MasterModel
{
ViewBag.Title = "officermaster";
Layout = "~/Views/Shared/_Citizenlayout.cshtml";
}
using (Html.BeginForm("officermaster", "Master", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
Officer Master
2 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vishal JoshiPosted Jun 8, 2024, 3:33 AM
Hello Garima,
There are several approaches you can use to achieve the solution.
Thanks
Vishal Joshi
Jignesh KumarPosted Jun 7, 2024, 11:41 AM
Hello Garima,
You can create below model and view model for both model in single model,
View model :
Sample Data which you need to bring from database,
Display in View :