title: how to clear ASP.net DropDownList show previous selected item
body: <p>please help me how to recover it. I used ddlHassection.Items.Clear(); but its not working properly.</p>
  
  <pre><code>using (var context = new SMAPPDBEntities())
  {
       var addDept = new SMDepartment
       {
            DepartmentCode = txtDeptCode.Text,
            DepartmentName = txtDeptName.Text,
            UnitID= Convert.ToInt32( ddlUnitName.SelectedValue),
            Description = txtDeptDescription.Text,
            DepartmentHead = Convert.ToInt32(ddlDeptHeadName.SelectedValue),
            HasSection = Convert.ToBoolean(ddlHasSection.SelectedValue),
            Tag= txtDeptTag.Text
        };
        try
        {
             context.SMDepartment.Add(addDept);
             context.SaveChanges();
         }
         catch (Exception ex)
         {
             ex.ToString();
         }
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/3DU4D.png" alt="enter image description here"><img src="https://i.stack.imgur.com/3DU4D.png" alt="enter image description here"></p>