Often seen on the first (asynchronous) load. In the Firefox console, I see this
[11:42:31.052] The character encoding of the plain text document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the file needs to be declared in the transfer protocol or file needs to use a byte order mark as an encoding signature. @ https://.../Dashboard/ChartImage.axd?UseSession=true&ChartID=6a20948d-8463-41a9-9282-158c82e54707_chart_ctl00$campaignChart&imageFormat=Png&random=3e42c05b-36d6-43bb-aa0a-9f202bb8b2cd
If I don't get the error, I don't see that log.
What we're doing is pretty standard:
Control ascx
Code behind C#
Except that it's asynchronously loaded - the data can take a while to be available via a WebHandler
[11:42:31.052] The character encoding of the plain text document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the file needs to be declared in the transfer protocol or file needs to use a byte order mark as an encoding signature. @ https://.../Dashboard/ChartImage.axd?UseSession=true&ChartID=6a20948d-8463-41a9-9282-158c82e54707_chart_ctl00$campaignChart&imageFormat=Png&random=3e42c05b-36d6-43bb-aa0a-9f202bb8b2cd
If I don't get the error, I don't see that log.
What we're doing is pretty standard:
Control ascx
<
telerik:RadChart
ID
=
"campaignChart"
runat
=
"server"
DefaultType
=
"Bar"
Skin
=
"Web20"
Width
=
"150px"
Height
=
"230px"
PlotArea-YAxis-Appearance-MinorGridLines-Visible
=
"false"
PlotArea-YAxis-Appearance-MajorGridLines-Visible
=
"false"
PlotArea-XAxis-Appearance-MajorTick-Visible
=
"false"
PlotArea-XAxis-Appearance-LabelAppearance-Visible
=
"false"
PlotArea-YAxis-Appearance-MinorTick-Visible
=
"false"
>
</
telerik:RadChart
>
Code behind C#
List<lastCampaignActivityStats> chartData =
new
List<lastCampaignActivityStats>();
chartData.Add(
new
lastCampaignActivityStats(
"total"
, total));
...
chartData.Add(
new
lastCampaignActivityStats(
"clicked"
, clicked));
ChartSeries emailChartSeries =
new
ChartSeries();
emailChartSeries.Type = ChartSeriesType.Bar;
//styles for disabling all the default
emailChartSeries.Appearance.Border.Visible =
false
;
emailChartSeries.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.Nothing;
emailChartSeries.Appearance.DiameterScale = 1;
emailChartSeries.Appearance.TextAppearance.Visible =
false
;
emailChartSeries.Appearance.LabelAppearance.Visible =
false
;
emailChartSeries.Appearance.LabelAppearance.LabelConnectorStyle.Visible =
false
;
campaignChart.Appearance.Border.Visible =
false
;
campaignChart.ChartTitle.Visible =
false
;
campaignChart.ChartTitle.Appearance.Visible =
false
;
campaignChart.Legend.Visible =
false
;
campaignChart.Legend.Appearance.Visible =
false
;
campaignChart.PlotArea.Appearance.Dimensions.Margins =
new
Telerik.Charting.Styles.ChartMargins(10, 0, 10, 50);
campaignChart.PlotArea.Appearance.Border.Visible =
false
;
campaignChart.IntelligentLabelsEnabled =
false
;
//data source
campaignChart.DataSource = chartData;
//add series
campaignChart.Series.Add(emailChartSeries);
campaignChart.Series[0].DataYColumn =
"Value"
;
campaignChart.Series[0].PlotArea.YAxis.LabelStep = 5;
campaignChart.DataBind();
Except that it's asynchronously loaded - the data can take a while to be available via a WebHandler
/// <summary>
/// Enables processing of HTTP Web requests by a custom HttpHandler that implements the <see cref="T:System.Web.IHttpHandler" /> interface.
/// </summary>
/// <param name="context">An <see cref="T:System.Web.HttpContext" /> object that provides references to the intrinsic server objects (for example, Request, Response, Session, and Server) used to service HTTP requests.</param>
public
void
ProcessRequest(HttpContext context)
{
using
(var writer =
new
StringWriter())
{
var pageHolder =
new
Page();
var control = (UserControl)pageHolder.LoadControl(
"~/Dashboard/UserControls/LastEmailCampaignActivity.ascx"
);
pageHolder.Controls.Add(control);
context.Server.Execute(pageHolder, writer,
false
);
context.Response.ContentType =
"text/html"
;
context.Response.Write(writer.GetStringBuilder().ToString());
}
}