protected void ShowPageInfo(PagesCMSDB db) { bool valid = true; string pagecmsid = Request.QueryString["pagecmsid"]; if (String.IsNullOrEmpty(pagecmsid)) { valid = false; } if (valid) { PageCMS pagecms_record = db.FindPageCMS(Int32.Parse(pagecmsid)); pagecms_title.Text = pagecms_record.GetCMStitle(); pagecms_body.Text = pagecms_record.GetCMSbody(); } //if not valid if (!valid) { PageUpdateCMS.InnerHtml = "There was an error finding that page."; } }
protected void ShowPageInfo(PagesCMSDB db) { //Debug.WriteLine allows to check for errors in the Debug Output window easier Debug.WriteLine("I am trying to show a page"); bool valid = true; string pagecmsid = Request.QueryString["pagecmsid"]; if (String.IsNullOrEmpty(pagecmsid)) { valid = false; } if (valid) { //finds page title and body info and displays it PageCMS page_record = db.FindPageCMS(Int32.Parse(pagecmsid)); Debug.WriteLine("the page is " + page_record.GetCMStitle()); page_title.InnerHtml = page_record.GetCMStitle(); page_body.InnerHtml = page_record.GetCMSbody(); } else { valid = false; } if (!valid) { //displays if the user goes to the page directly and not from //the list page pagecms.InnerHtml = "There was an error finding that page."; } }