title: how to specify Default value for dropdown i have populated from database using Viewbag in mvc
body: <p>heloo guys i have populated dropdownlist from database in mvc using Viewbag object now i want to specify default value for it like Select Supplier here is my Controler code..</p>
  
  <pre><code> public ActionResult Create()
      {
          //IEnumerable&lt;SelectListItem&gt; SuppliersList = db.Suppliers.Select(c =&gt; new SelectListItem
          //{
          //    Value = c.Name,
          //    Text = c.Name
  
          //});            
  
          ViewBag.SupplierList = new SelectList(db.Suppliers, "Name", "Name");
          return PartialView("_Create");
      }
  
      // POST: /Frames/Create
      // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
      // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
      [HttpPost]
      [ValidateAntiForgeryToken]
      public async Task&lt;ActionResult&gt; Create([Bind(Include="FrameId,Name,FrameCode,FrameFor,Brand,Material,Color,FrameType,FrameShape,Bridge,LensWidth,FrameWidth,TempleLength,LensHeight,FrameWeight,Quantity,PurchaseRate,SaleRate,Supplier,Discription,Status,CreatedOn")] Frame frame)
      {
  
          if (ModelState.IsValid)
          {
              db.Frames.Add(frame);
              await db.SaveChangesAsync();
              return Json(new { success = true });
          }
  
  
  
          return PartialView("_Create", frame);
      }
  </code></pre>
  
  <p>and my ViewCode</p>
  
  <pre><code>&lt;div class="col-md-3"&gt;
                      @Html.LabelFor(model =&gt; model.Supplier)
                      @Html.DropDownList("Supplier", ViewBag.SupplierList as SelectList, new { @class = "form-control"})
                      @Html.ValidationMessageFor(model =&gt; model.Supplier)
                  &lt;/div&gt;
  </code></pre>