title: Redirect with ID that was just created
body: <p>I need to redirect my page based off of the ID that was just created.
  This is my insert statement that generates the ID that I will need to fetch for the redirect. </p>
  
  <pre><code>'SQL Insert: Product table
     Dim sqlInsertProduct As String = "INSERT INTO Product 
                                      (ProductName, Status, CreateDate, ModifyDate, 
                                      CreateUser, ModifyUser, Price) 
                                      VALUES (@ProductName, @Status ,getdate(),
                                      getdate(), @CreateUser, @ModifyUser, @Price)
                                      ;SELECT SCOPE_IDENTITY();"
     Using cmd As New SqlCommand(sqlInsertProduct, cn)
      Dim ProductID As String
     cmd.Parameters.Add(New SqlParameter("@ProductName", txtNewProductName.Text))
     cmd.Parameters.Add(New SqlParameter("@Status", StatusCheckbox.Checked))
     cmd.Parameters.Add(New SqlParameter("@Price", txtPrice.Text))
     cmd.Parameters.Add(New SqlParameter("@CreateUser",
     System.Web.HttpContext.Current.User.Identity.Name))
     cmd.Parameters.Add(New SqlParameter("@ModifyUser",
   System.Web.HttpContext.Current.User.Identity.Name))
      cn.Open()
      ProductID = cmd.ExecuteScalar()
   End Using
  
  Response.Redirect("Product/Default.aspx?id=" + ProductID)
  </code></pre>
  
  <p>The Response.Redirect is all the way at the bottom of the page after 3 other inserts into 3 different tables. The only thing I can think of to make this work is to put the redirect into that using, but I can't because I need the other tables to get inserted into and it wouldn't make sense to redirect before the rest of the inserts.</p>