display data using Ajax

create normal view like here I am creating with dropdown and if somebosy will change dropdown value thn accordingly I displaying data
create view to display data
        public ActionResult UsingAjax()
            int userID = Convert.ToInt32(Session["User_ID"]);
            List accountDetails = db.Account.Where(x => x.LoginID == userID).ToList();
            return View(accountDetails);

then have the view to display accountname dropdown

@model IEnumerableAccountDetail>
<body style="background-color:#FFF3E8;">

Passing Multiple Models using PartialView

Select a Course

Check account with details information

Create partial view also

@model IEnumerable

@foreach (var item in Model)
Account IDFaculty NameAccount BalanceCountry

and Call the AccountDEtailtable methos in you control
        public ActionResult AccountDetailTable(string AccountName)
            int userID = Convert.ToInt32(Session["User_ID"]);
            var account = db.Account.Where(x => x.LoginID == userID && x.AccountName == AccountName).ToList();
            return PartialView("AccountDetailsPV", account);

No comments: