开发者

How to use BinaryStreaming rendertype in ASP.Net Charting control using ajax call in ASP.Net MVC framework

开发者 https://www.devze.com 2022-12-21 08:27 出处:网络
Can anybody give a code snippet which will explain how to use Binary streaming render type in ASP.Net Cha开发者_JAVA百科rting controls using $.ajax call in ASP.Net MVC Framework. ?

Can anybody give a code snippet which will explain how to use Binary streaming render type in ASP.Net Cha开发者_JAVA百科rting controls using $.ajax call in ASP.Net MVC Framework. ?

Ajax call will look like this-->

$.ajax({              

    type: "POST",

    url: "/DrawChart/" + drawingParamter1+ "/" + drawingParamter2,

    dataType: someSuitableDataType,

    error: function(error) {

    },

    success: function(html) {

    }
});


I am not sure why do you want to use ajax to call a binary stream, but this blog post shows you how to do the binary stream using or using a control.

http://setiabud.blogspot.com/2010/02/using-aspnet-chart-controls-in-aspnet.html


You might want to take a look at these links:

http://msdn.microsoft.com/en-us/library/dd456682.aspx http://support2.dundas.com/OnlineDocumentation/WebChart2005/ImageMaps_ImageMapBinary.html

Found it after a lot of searching.


The dundas link is quite dated, requiring the chart control to be duplicated in the content page, and also in the handler page. A really slick (and easy) way that takes a bit of reading to fully understand is to use an img tag in the content page with imageUrl pointing to the handler page, and adding query string at runtime passing in any required parameters.

You have 2 options for the handler page - either an ashx, or an aspx page containing no markup except for the chart control. This 2nd method makes it easy to style certain elements of the chart in the designer, and wire up the rest at runtime.

See link asp.net:Invalid temp directory in chart handler configuration [c:\TempImageFiles\] (and in particular, scroll down to reply by Stefan Steiger) and also https://web.archive.org/web/20201205231110/https://www.4guysfromrolla.com/articles/081909-1.aspx (a little bit out of date).

0

精彩评论

暂无评论...
验证码 换一张
取 消