/// <summary> /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled. /// </summary> /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param> public override void RenderControl(HtmlTextWriter writer) { if (this.Visible) { writer.AddAttribute("rowid", ID); writer.RenderBeginTag(HtmlTextWriterTag.Tr); writer.AddAttribute("data-label", "Role"); writer.RenderBeginTag(HtmlTextWriterTag.Td); writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group" + (_rblRole.IsValid ? "" : " has-error")); writer.RenderBeginTag(HtmlTextWriterTag.Div); _rblRole.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); if (this.ShowTitle) { writer.AddAttribute("data-label", "Title"); writer.RenderBeginTag(HtmlTextWriterTag.Td); _dvpTitle.RenderControl(writer); writer.RenderEndTag(); } writer.AddAttribute("data-label", "Name"); writer.RenderBeginTag(HtmlTextWriterTag.Td); writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group" + (_tbFirstName.IsValid ? "" : " has-error")); writer.RenderBeginTag(HtmlTextWriterTag.Div); _tbFirstName.RenderControl(writer); writer.RenderEndTag(); if (this.ShowNickName) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group" + (_tbNickName.IsValid ? "" : " has-error")); writer.RenderBeginTag(HtmlTextWriterTag.Div); _tbNickName.RenderControl(writer); writer.RenderEndTag(); } if (this.ShowMiddleName) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group" + (_tbMiddleName.IsValid ? "" : " has-error")); writer.RenderBeginTag(HtmlTextWriterTag.Div); _tbMiddleName.RenderControl(writer); writer.RenderEndTag(); } writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group" + (_tbLastName.IsValid ? "" : " has-error")); writer.RenderBeginTag(HtmlTextWriterTag.Div); _tbLastName.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); if (this.ShowSuffix) { writer.AddAttribute("data-label", "Suffix"); writer.RenderBeginTag(HtmlTextWriterTag.Td); _dvpSuffix.RenderControl(writer); writer.RenderEndTag(); } writer.AddAttribute("data-label", "Connection Status"); writer.RenderBeginTag(HtmlTextWriterTag.Td); _dvpConnectionStatus.RenderControl(writer); writer.RenderEndTag(); writer.AddAttribute("data-label", "Gender"); writer.RenderBeginTag(HtmlTextWriterTag.Td); writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group" + (_rblGender.IsValid ? "" : " has-error")); writer.RenderBeginTag(HtmlTextWriterTag.Div); _rblGender.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); writer.AddAttribute("data-label", "Birthdate"); writer.RenderBeginTag(HtmlTextWriterTag.Td); writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group" + (_dpBirthdate.IsValid ? "" : " has-error")); writer.RenderBeginTag(HtmlTextWriterTag.Div); _dpBirthdate.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); if (ShowGradeColumn) { writer.AddAttribute("data-label", "Grade"); writer.RenderBeginTag(HtmlTextWriterTag.Td); if (ShowGradePicker) { _ddlGradePicker.RenderControl(writer); } writer.RenderEndTag(); } writer.AddAttribute("data-label", "Cancel"); writer.RenderBeginTag(HtmlTextWriterTag.Td); _lbDelete.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); } }
/// <summary> /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled. /// </summary> /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param> public override void RenderControl(HtmlTextWriter writer) { if (this.Visible) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _lbDelete.RenderControl(writer); writer.RenderEndTag(); writer.RenderBeginTag(HtmlTextWriterTag.H4); writer.Write(Caption); writer.RenderEndTag(); writer.AddAttribute("rowid", ID); writer.AddAttribute(HtmlTextWriterAttribute.Class, "row clearfix"); writer.RenderBeginTag(HtmlTextWriterTag.Div); bool existingPerson = (this.PersonId > 0); _lNickName.Visible = existingPerson; _lLastName.Visible = existingPerson; _tbNickName.Visible = !existingPerson; _tbLastName.Visible = !existingPerson; writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _lNickName.RenderControl(writer); _tbNickName.RenderControl(writer); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _lLastName.RenderControl(writer); _tbLastName.RenderControl(writer); writer.RenderEndTag(); if (this.ShowSuffix) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _ddlSuffix.RenderControl(writer); writer.RenderEndTag(); } if (this.ShowGender) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _ddlGender.RenderControl(writer); writer.RenderEndTag(); } if (this.ShowBirthDate) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _dpBirthdate.RenderControl(writer); writer.RenderEndTag(); } if (this.ShowGrade) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _ddlGradePicker.RenderControl(writer); writer.RenderEndTag(); } if (this.ShowMobilePhone) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _pnbMobile.RenderControl(writer); writer.RenderEndTag(); } foreach (Control attributeCtrl in _phAttributes.Controls) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3"); writer.RenderBeginTag(HtmlTextWriterTag.Div); attributeCtrl.RenderControl(writer); writer.RenderEndTag(); } writer.RenderEndTag(); // Relationship writer.AddAttribute(HtmlTextWriterAttribute.Class, "row"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _ddlRelationshipType.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); writer.RenderBeginTag(HtmlTextWriterTag.Hr); writer.RenderEndTag(); } }
/// <summary> /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled. /// </summary> /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param> public override void RenderControl(HtmlTextWriter writer) { if (this.Visible) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _lbDelete.RenderControl(writer); writer.RenderEndTag(); writer.RenderBeginTag(HtmlTextWriterTag.H4); writer.Write(Caption); writer.RenderEndTag(); // Relationship writer.AddAttribute(HtmlTextWriterAttribute.Class, "row"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(6)); writer.RenderBeginTag(HtmlTextWriterTag.Div); _ddlRelationshipType.RenderControl(writer); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(6)); // filler/blocker column writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.RenderEndTag(); writer.RenderEndTag(); // end Relationship row writer.AddAttribute("rowid", ID); writer.AddAttribute(HtmlTextWriterAttribute.Class, "row clearfix"); writer.RenderBeginTag(HtmlTextWriterTag.Div); bool existingPerson = (this.PersonId > 0); _lNickName.Visible = existingPerson; _lLastName.Visible = existingPerson; _tbNickName.Visible = !existingPerson; _tbLastName.Visible = !existingPerson; writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(3)); writer.RenderBeginTag(HtmlTextWriterTag.Div); _lNickName.RenderControl(writer); _tbNickName.RenderControl(writer); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(3)); writer.RenderBeginTag(HtmlTextWriterTag.Div); _lLastName.RenderControl(writer); _tbLastName.RenderControl(writer); writer.RenderEndTag(); if (this.ShowGender) { writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(3)); writer.RenderBeginTag(HtmlTextWriterTag.Div); _ddlGender.RenderControl(writer); writer.RenderEndTag(); } if (this.ShowSuffix) { writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(3)); writer.RenderBeginTag(HtmlTextWriterTag.Div); _ddlSuffix.RenderControl(writer); writer.RenderEndTag(); } if (this.ShowBirthDate) { writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(6)); writer.RenderBeginTag(HtmlTextWriterTag.Div); _bpBirthdate.RenderControl(writer); writer.RenderEndTag(); } if (this.ShowGrade) { writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(3)); writer.RenderBeginTag(HtmlTextWriterTag.Div); _ddlGradePicker.RenderControl(writer); writer.RenderEndTag(); } if (this.ShowMobilePhone) { writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(3)); writer.RenderBeginTag(HtmlTextWriterTag.Div); _pnbMobile.RenderControl(writer); writer.RenderEndTag(); } if (this.ShowEmailAddress) { writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(6)); writer.RenderBeginTag(HtmlTextWriterTag.Div); _ebEmail.RenderControl(writer); writer.RenderEndTag(); } if (this.ShowCommunicationPreference) { writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(6)); writer.RenderBeginTag(HtmlTextWriterTag.Div); _rblCommunicationPreference.RenderControl(writer); writer.RenderEndTag(); } foreach (Control attributeCtrl in _phAttributes.Controls) { writer.AddAttribute(HtmlTextWriterAttribute.Class, GetColumnStyle(3)); writer.RenderBeginTag(HtmlTextWriterTag.Div); attributeCtrl.RenderControl(writer); writer.RenderEndTag(); } writer.RenderEndTag(); writer.RenderBeginTag(HtmlTextWriterTag.Hr); writer.RenderEndTag(); } }