protected void Event40_Click(object sender, EventArgs e) { if (Session["username"] != null) { if (Event40.Text == "Register") { DBOperations.AddEvent(Session["username"].ToString(), "Event40"); Event40.Text = "Registered"; } } else { Response.Redirect("Registration.aspx"); } }