protected void Button1_Click(object sender, EventArgs e) { Booth b = new Booth(); if (b.checkBoothExists(Convert.ToInt32(ViewState["userID"])) == false) { b.createBooth(Convert.ToInt32(ViewState["userID"]), TextBox1.Text); ScriptManager.RegisterStartupScript(this, typeof(string), "CreateBoothSuccessScript", "alert('Booth created successfully');window.open('SellerManageBooth.aspx', '_self');", true); System.Windows.Forms.MessageBox.Show("Booth created successfully"); Response.Redirect("~/SellerManageBooth.aspx"); } else { System.Windows.Forms.MessageBox.Show("You already own a booth! Redirecting you to Market page"); Response.Redirect("~/Panaroma.aspx"); } }