views:

165

answers:

0

i want to save selected values from dropdownlist in edit mode. can u plz tell me how to do that...? here's my code:

[AcceptVerbs(HttpVerbs.Post)]
    public ActionResult Edit( Requirements reqToEdit, FormCollection frm)
    {
        try
        {
           // var dropdownlistname= int.Parse(frm["aa"]);

            // TODO: Add update logic here
            var reqInfo = (from r in _db.Requirements
                           where r.ReqId == reqToEdit.ReqId
                           select r).First();
            if (!ModelState.IsValid)
                return View(reqInfo);

             **// this is where  i want to get the selected status value from the 
            // dropdownlist and update the object. 
           // reqToEdit.reqStatus =Convert.ToInt32(dropdownlistname);** 



            _db.ApplyPropertyChanges(reqInfo.EntityKey.EntitySetName, reqToEdit);
            _db.SaveChanges();

            return RedirectToAction("Index");
        }
        catch
        {
            return View();
        }
    }