I have FormView in Category_New.aspx from where new item is inserted. It is inserted in following method.
 public void myForm_InsertItem()
    {            
        var item = new A.Models.Category();
        CategoryContext db = new CategoryContext();            
        TryUpdateModel(item);
        if (ModelState.IsValid)
        {
            // Save changes here
            db.Category.Add(item);
            db.SaveChanges();
            //item.CategoryID is present from this point
        }
    }
I would like to redirect a user to the page that is for editing that Item. That page is Category_Edit.aspx.
How to get ID of inserted item in method myForm_ItemInserted so that the following code would work?
protected void myForm_ItemInserted(object sender, FormViewInsertedEventArgs e)
{
     Response.RedirectToRoute(GetRouteUrl("CategoryEdit", new {CategoryID = /* how to get ID of inserted item??? */}));            
}
How to know the ID of inserted item?
 
     
    