protected void btnSaveAuthor_Click(object sender, EventArgs e) { author.AutherName = txtAuthorName.Text; author.AutherEmail = txtEmail.Text; author.AutherConatct = txtContact.Text; author.isActive = true; if (btnSaveAuthor.Text == "Update") { author.AuthorId = Convert.ToInt32(Session["AuthorEditId"]); AF.SaveAuthor(author); Session["AuthorEditId"] = ""; Response.Redirect("ViewAuthor.aspx"); } else { AF.SaveAuthor(author); //lblMessage.Text = "Author Added Successfully"; ClearData(); Response.Redirect("ViewAuthor.aspx"); } }