Why do you return the image generated by a Chart control, rather than use it in a view in ASP.NET MVC?
-
19-09-2019 - |
Question
Why can't you use the Chart control directly in views? Why do you have to return the image generated?
Solution
Although there are ways to get WebForms working with MVC, however, fundamentally WebForms controls cannot work in ASP.NET MVC Views as 'WebForms Templates'. Clue is in the name.. APS.NET MVC uses the WebForms as templates, so you don't get the full page life-cycle events and so on in ASP.NET MVC views.
If you don't want to generate images, another option is to use a javascript based graph utility (based on jQuery).
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow