protected override void Render(HtmlTextWriter writer) { Literal lit = new Literal(); lit.Text = RenderRating(); if (Enabled) { CallBackContent cbContent = new CallBackContent(); cbContent.Controls.Add(lit); cb.Content = cbContent; cb.RenderControl(writer); } else { lit.RenderControl(writer); } }
protected override void Render(HtmlTextWriter output) { try { output = new HtmlTextWriter(output, string.Empty); string sOutput = this.HeaderTemplate.Text + this.ItemTemplate.Text + this.FooterTemplate.Text; div.Controls.Add(Page.ParseControl(sOutput)); div.RenderControl(output); if (this.ShowPager) { output.AddAttribute("id", "pager_" + this.ClientID); output.RenderBeginTag(HtmlTextWriterTag.Div); output.RenderEndTag(); } cb.RenderControl(output); StringBuilder str = new StringBuilder(); str.Append("<script>"); str.Append("window." + this.ClientID + "=new ActiveGrid('" + this.ClientID + "');"); if (this.SpacerImage == "") { this.SpacerImage = Page.ClientScript.GetWebResourceUrl(this.GetType(), "DotNetNuke.Modules.ActiveForums.CustomControls.Resources.spacer.gif"); } if (this.AscImage == "") { this.AscImage = Page.ClientScript.GetWebResourceUrl(this.GetType(), "DotNetNuke.Modules.ActiveForums.CustomControls.Resources.asc.gif"); } if (this.DescImage == "") { this.DescImage = Page.ClientScript.GetWebResourceUrl(this.GetType(), "DotNetNuke.Modules.ActiveForums.CustomControls.Resources.desc.gif"); } str.Append("window." + this.ClientID + ".SpacerImage='" + this.SpacerImage + "';"); str.Append("window." + this.ClientID + ".AscImage='" + this.AscImage + "';"); str.Append("window." + this.ClientID + ".DescImage='" + this.DescImage + "';"); str.Append("window." + this.ClientID + ".SetColumns();"); if (this.ShowPager) { str.Append("window." + this.ClientID + ".Pager=document.getElementById('pager_" + this.ClientID + "');"); str.Append("window." + this.ClientID + ".PagerText='" + this.PagerText + "';"); str.Append("window." + this.ClientID + ".PagerPages=" + this.PagerPages + ";"); str.Append("window." + this.ClientID + ".CssPagerInfo='" + this.CssPagerInfo + "';"); str.Append("window." + this.ClientID + ".CssPagerItem='" + this.CssPagerItem + "';"); str.Append("window." + this.ClientID + ".CssPagerItem2='" + this.CssPagerItem2 + "';"); str.Append("window." + this.ClientID + ".CssPagerCurrentNumber='" + this.CssPagerCurrentNumber + "';"); str.Append("window." + this.ClientID + ".CssPagerNumber='" + this.CssPagerNumber + "';"); } str.Append("window." + this.ClientID + ".Column='" + this.DefaultColumn + "';"); if (this.DefaultSort == Sort.Ascending) { str.Append("window." + this.ClientID + ".Sort='ASC';"); str.Append("window." + this.ClientID + ".DefaultSort='ASC';"); } str.Append("window." + this.ClientID + ".Params='" + this.DefaultParams + "';"); str.Append("window." + this.ClientID + ".Width='" + this.Width.ToString() + "';"); str.Append("window." + this.ClientID + ".ImagePath='" + Page.ResolveUrl(this.ImagePath) + "';"); str.Append("window." + this.ClientID + ".ItemStyle='" + this.ItemStyle + "';"); str.Append("window." + this.ClientID + ".AltItemStyle='" + this.AltItemStyle + "';"); str.Append("window." + this.ClientID + ".SelectedStyle='" + this.SelectedStyle + "';"); str.Append("window." + this.ClientID + ".PageSize=" + this.PageSize.ToString() + ";"); str.Append("window." + this.ClientID + ".RowDelimiter='" + this.RowDelimiter + "';"); str.Append("window." + this.ClientID + ".ColDelimiter='" + this.ColDelimiter + "';"); str.Append("window." + this.ClientID + ".ShowPager=" + this.ShowPager.ToString().ToLower() + ";"); str.Append("window." + this.ClientID + ".CB='" + cb.ClientID + "';"); if (this.LoadOnRender == true) { str.Append("window." + this.ClientID + ".Callback();"); } str.Append("</script>"); output.Write(str.ToString()); } catch (Exception ex) { } }