title: How to populate the form fields for updation purpose based on the dropdown list selected item in entity framework?
body: <p>I'm working on Content Management System in ASP .Net and I have been working on the updating operation using an EF code first approach, but I'm not able to populate the form fields based on the selected item from the dropdown list.</p>
  
  <p>I tried to populate the form field, but I'm not able to do so, I tried the methods like <code>.Find()</code> but it is not working</p>
  
  <pre><code>protected void ddlSelectCourse_SelectedIndexChanged(object sender, EventArgs e)
      {
          CourseInfo ci = new CourseInfo();
          var selectedId = ci.Id;
  
          var obj = irep.GetSingleCourse(selectedId);
          txtCourseName.Text = obj.CourseName;  
  
      }
  </code></pre>
  
  <p>I want to populate <code>txtCourseName.Text</code> field to be populated by the Course name</p>