Hi i have three Fields in my view.That three fields are drop down. I want to pass the value to these fields when edit button is clicked. That is the values need to pass to that drop down fields. My view is mentioned below

[![DropDown](https://i.stack.imgur.com/wE6xo.jpg)](https://i.stack.imgur.com/wE6xo.jpg)

In my view i have many drop downs but once i know how to pass the value to one drop down means i will do for another drop downs.

For Edit i create one view in sql and connect that view as EDMX file in my application.In this view(table) i have all fields which is in Visitors Form. That view name is View\_VisitorsForm. 

**My Model(VisitorsViewModel)**

```
    public Nullable<System.DateTime> Date { get; set; }
    public System.Guid VisitingID { get; set; }
    public Nullable<System.Guid> EmployeeID { get; set; }
    public string EmployeeName { get; set; }
    public string Description { get; set; }

```

**My Edit Code**

```
      public ActionResult Edit(Guid ?id)
      {
             WafeERPNEWEntities db = new WafeERPNEWEntities();
        SelectList typelist = new SelectList(db.Employees.ToList(), "EmployeeID", "DisplayName",  db.Employees);
        ViewData["EmployeeName"] = typelist;
        if (id == null)
        {
            return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
        }
        VisitorsViewModel ObjVisitorsviewModel = new VisitorsViewModel();
        View_VisitorsForm visit = db.View_VisitorsForm.Find(id);
        visit.VisitingID = ObjVisitorsviewModel.VisitingID;
        visit.VisitingDate = ObjVisitorsviewModel.Date;
        visit.Description = ObjVisitorsviewModel.Description;
                 if (ObjVisitorsviewModel == null)
        {
            return HttpNotFound();
        }

        return View(ObjVisitorsviewModel);
    }

```

**My View Code**

```
        @Html.LabelFor(model => model.Date)
        @Html.EditorFor(model => model.Date)
        @Html.ValidationMessageFor(model => model.Date)

        @Html.LabelFor(model => model.VisitingID)
        @Html.EditorFor(model => model.VisitingID)
        @Html.ValidationMessageFor(model => model.VisitingID)

        @Html.LabelFor(model => model.EmployeeName)
        @Html.DropDownList("EmployeeID", (IEnumerable<SelectListItem>)ViewData["EmployeeName"])
        @Html.ValidationMessageFor(model => model.EmployeeName)

```

Now when i click the edit button it pass the value to this line 

```
    View_VisitorsForm visit = db.View_VisitorsForm.Find(id);

```

and also it getting visit.visitingID. But it is not getting the value in viewmodel .so the value will be empty in view.All values are empty VisitingID, Description, Date Fields are empty and in Employee drop down it won't show the value which i passed to this field it shows the first value in dropdown. so please any one tell me how to solve this issue. Actually I try to explain my issue as per my level best and if you didn't understand my issue or any one need my full code or need more code tell me . i ready to update my code again. but i need solution.

Advance Thanks..