Click here to Skip to main content
15,881,600 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
i'm beginner in asp.net mvc,i'm using tab for action of crud 
tab1 - show user list,
tab2-add user
tab3-edit user on dropdownlist selection ,get all details in textbox on dropdownlist selection.
 

tab1 - show user list,
tab2-add user
tab3-edit user on dropdownlist selection ,get all details in textbox on dropdownlist selection.
 

the question how can i perform it .i'm completed tab1 and tab 2 task ,but unable do tab3 work which is how get selected detail set in text box from database on selection on dropdownlist (in dropdownlist show the list of employee name)

please help 
Thanks in advance


What I have tried:

C#
public ActionResult Qsupport()
      {
          UserViewModel userViewModel = new UserViewModel();
          using (CompanyDBEntities e = new CompanyDBEntities())
          {
              var userLists = e.sd_admin.ToList();
              var username = new SelectList(e.sd_admin.ToList(), "uid", "uname");
              ViewData["username"] = username;
              userViewModel.adminsList = userLists;
              userViewModel.admin = new sd_admin();
              return View(userViewModel);
          }
      }


      public ActionResult AlluserList()
      {
          return PartialView("AlluserList");
      }
      public ActionResult AddUser()
      {
          return View();
      }
      public ActionResult AddUser(UserViewModel userViewModel)
      {
          if (ModelState.IsValid)
          {
              sd_admin sd_Admin = new sd_admin();
              DbObjectConverter.CopyProperties(userViewModel.admin, sd_Admin);
              //sd_Admin.password = user.User.Password;
              sd_Admin.rights = "";
              sd_Admin.ustatus = "";
              sd_Admin.lastupdated = DateTime.Now.ToShortDateString();

              using (CompanyDBEntities e = new CompanyDBEntities())
              {
                  e.sd_admin.Add(sd_Admin);
                  try
                  {
                      e.SaveChanges();
                      string uid = userViewModel.admin.uid;

                  }
                  catch (Exception ex)
                  {

                  }

              }

          }
          return View("Qsupport", userViewModel);
      }
Posted
Updated 17-Mar-21 5:38am
v4
Comments
Richard Deeming 5-Oct-20 9:48am    
You seem to have forgotten to ask a question.
Member 13698531 6-Oct-20 3:21am    
tab1 - show user list,
tab2-add user
tab3-edit user on dropdownlist selection ,get all details in textbox on dropdownlist selection.


the question how can i perform it .i'm completed tab1 and tab 2 task ,but unable do tab3 work which is how get selected detail set in text box from database on selection on dropdownlist (in dropdownlist show the list of employee name)

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