Posted on: 6/18/2013 6:21:52 PM | Views : 436

I'm am scripting an addon to my page that will have it check a Table and if the column is set to 0 or 1 it will either redirect to a maintience page. for some reason my code is off. I think it has to do with my isMaint varible. Any ideas?
 
protected void Page_PreRender(object sender, EventArgs e) { bool isMaint = CheckMaintFlag(); //Call the database to see if job ran and set the dataIsAvailable accordingly if (isMaint) { Response.Redirect(URL); pnlMaint.Visible = true; pnlForm.Visible = false; } else { pnlMaint.Visible = false; pnlForm.Visible = true; } } private bool CheckMaintFlag() { bool isMaint = false; using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["samConnectionString"].ConnectionString)) { ...

Go to the complete details ...