protected void Button1_Click(object sender, EventArgs e) { String name = TextBox1.Text.Trim(); using (LiBoClothesShopEntities context = new LiBoClothesShopEntities()) { GenderInfo newObj = new GenderInfo() { Name = name }; context.AddToGenderInfoes(newObj); context.SaveChanges(); Response.Redirect("~/Default.aspx"); } }