title: Datalist get selected item value
body: <p>I have a database which contains a table named Quiz, and has the columns [QuizID, Name, Level]. I am filling a <code>DataList</code> using the EF wizard with data from the database. </p>
  
  <p>I need to get the Quiz ID (Primary key) of the item that I click on in the <code>DataList</code> so that I can pass it to stored procedures. How do I get the ID in the click event?</p>
  
  <pre><code>protected void Button1_Click(object sender, EventArgs e)
  {
      using (DBEntities db = new DBEntities())
      {
          string ID = Session["ID"].ToString();
          var level = (from tbl in db.CheckLevel(ID) select tbl).FirstOrDefault();
          var quizLevel = ??
      }
  }
  </code></pre>