This is a migrated thread and some comments may be shown as answers.

Removing unnecessary attributes and elements

3 Answers 76 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
JT
Top achievements
Rank 1
JT asked on 14 Jun 2010, 07:43 PM
How can I disable RadChart from rendering a style, the javascript onerror call, and the additional script block.  I want to simply show a RadChart that does not involve any further user interaction nor postbacks.

For example, here's what my RadChart outputs:
<div id="ctl04_BarCharts_ctrl1_BarChart" class=" RadChart" style="height:44px;width:293px;"
    <img alt='' style='border-width: 0px;'  src='ChartImage.axd?UseSession=true&amp;ChartID=530d344a-c0c1-408c-b083-88a56c512866_chart_ctl04$BarCharts$ctrl1$BarChart&amp;imageFormat=Png&amp;random=0.0234165825058783' onerror="if(confirm('Error loading RadChart image.\nYou may also wish to check the ASP.NET Trace for further details.\nDisplay stack trace?'))window.location.href=this.src;" /><input id="ctl04_BarCharts_ctrl1_BarChart_ClientState" name="ctl04_BarCharts_ctrl1_BarChart_ClientState" type="hidden" /> 
</div><script type="text/javascript"
//<![CDATA[ 
    Sys.Application.add_init(function(){});
//]]> 
</script> 
 


and here's what I'd like it to output:
<div id="ctl04_BarCharts_ctrl1_BarChart" class=" RadChart"
    <img alt='' src='ChartImage.axd?UseSession=true&amp;ChartID=530d344a-c0c1-408c-b083-88a56c512866_chart_ctl04$BarCharts$ctrl1$BarChart&amp;imageFormat=Png&amp;random=0.0234165825058783' /> 
</div>

or better yet:
    <img alt='' src='ChartImage.axd?UseSession=true&amp;ChartID=530d344a-c0c1-408c-b083-88a56c512866_chart_ctl04$BarCharts$ctrl1$BarChart&amp;imageFormat=Png&amp;random=0.0234165825058783' />  



3 Answers, 1 is accepted

Sort by
0
Vladimir Milev
Telerik team
answered on 17 Jun 2010, 05:21 PM
Hello JT,

The onerror call is only generated in debug mode. Once you deploy your app in production it will not get generated. Also, if you disable the ClientSettings ant AutoPostBack=false you will have less markup generated.

Kind regards,
Vladimir Milev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
JT
Top achievements
Rank 1
answered on 17 Jun 2010, 06:39 PM
Thanks for the response Vladimir.  Setting debug to false in the config did the trick for the javascript onerror.
How can I disable ClientSettings and where is the AutoPostBack property for RadChart?
0
Vladimir Milev
Telerik team
answered on 22 Jun 2010, 11:03 AM
Hi JT,

About the ClientSettings, you simply don't need to have such a tag in your .aspx file. If you have it then make sure that ClientSettings.ScrollMode is ChartClientScrollMode.None.

About the AutoPostBack functionality, I incidentally misled you. If you are not using any client-side scrolling and zooming (see above), and don't have any click events wired RadChart will automatically not render any javascript.

Best wishes,
Vladimir Milev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Chart (Obsolete)
Asked by
JT
Top achievements
Rank 1
Answers by
Vladimir Milev
Telerik team
JT
Top achievements
Rank 1
Share this question
or