MVC3.0 create the radiobuttonlist using ViewBagresults

Aug 20 2013 4:07 AM
Hi Please kindly help me for my Doubt


I have a controller
public class genders
  {
      public int genderid { get; set; }
      public String gendername { get; set; }
  }


  [HttpGet]
        public ActionResult Addfaculty()
        {
            empDBEntities st = new empDBEntities();
            var gends =
                (
                from gend in st.tblgenderbs
                select new genders
                {
                    genderid = gend.genderid,
                    gendername = gend.gendername
                }).ToList();
            ViewBag.gendername = gends;


            return View();
        }

how to create the Radiobuttonlist for that using viewbag results in viewpage please help me please write the code for that once....

Answers (5)