We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

I am getting reference error "does not contain definition for chart" in .cshtml file

I am using Pie chart, after building its model and passing model from controller to view i get following error in cshtml on "Html.Chart" that it does not contain definition for chart, even i am referencing all of the dlls mentioned in the "http://help.syncfusion.com/ug/asp.net%20mvc/default.htm#!documents/dlls.htm"

code  for cshtml is here
@(new HtmlString(Html.Chart("SimpleChart",(MVCChartModel)ViewData.Model).ToString()))

i am following this sample URL

i am referencing all of the dlls listed here

i am using asp.net MVC 4.0

Please give solution for the missing reference.

Attachment: error_80ae9487.zip

3 Replies

AB Akbar Basha K M Syncfusion Team October 29, 2014 09:08 AM UTC

Hi Raja,

Thanks for using syncfusion product. We have analyzed your requirements and we like to inform you that,

After adding DLL you need to do following steps as follows,

1.      In web configuration file, all the referenced Syncfusion assemblies should be registered in the <assemblies> section, namespace should be added for the assemblies in <namespaces> section





        <add assembly="Syncfusion.Core, Version=12.2400.0.36, Culture=neutral, PublicKeyToken=632609B4D040F6B4" />

        <add assembly="Syncfusion.Shared.Mvc, Version=12.2300.0.36, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" />

<add assembly="Syncfusion.Linq.Base, Version=12.2400.0.36, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" />

        <add assembly="Syncfusion.Theme.Base, Version=12.2400.0.36, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" />

        <add assembly="Syncfusion.Tools.Mvc, Version=12.2300.0.36, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" />

        <add assembly="Syncfusion.Chart.Base, Version=12.2400.0.36, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" />

        <add assembly="Syncfusion.Chart.Mvc, Version=12.2300.0.36, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" />

        <add assembly="Syncfusion.Compression.Base, Version=12.2400.0.36, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" />

        <add assembly="Syncfusion.Shared.Base, Version=12.2400.0.36, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" />

        <add assembly="Syncfusion.XlsIO.Mvc, Version=12.2300.0.36, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" />

        <add assembly="Syncfusion.Pdf.Base, Version=12.2400.0.36, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" />

        <add assembly="Syncfusion.DocIO.Mvc, Version=12.2300.0.36, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" />



        <add namespace="System.Web.Helpers" />

        <add namespace="System.Web.Mvc" />

        <add namespace="System.Web.Mvc.Ajax" />

        <add namespace="System.Web.Mvc.Html" />

        <add namespace="System.Web.Routing" />

        <add namespace="System.Web.WebPages" />

        <add namespace="System.Drawing" />

        <add namespace="Syncfusion.Mvc.Shared" />

        <add namespace="Syncfusion.Mvc.Tools" />

        <add namespace="Syncfusion.Mvc.Chart" />

        <add namespace="Syncfusion.Windows.Forms.Chart" />



And handlers for rendering chart should be added in <httpHandler> and <handlers> section.

Please refer the following online documentation link for adding code to web configuration file.


2.       Essential Chart also requires scripts and style sheets for user interactive features like tooltip, zooming, toolbar, context menu, etc., which should be added in the page that renders chart.

Please refer the following online documentation link for adding style sheets required for chart.


Please refer the following online documentation link for adding scripts required for user interaction in Essential Chart.


We have prepared a simple sample based on your requirement.

Please find the attached sample.

Please let us know if you have any concern.


Akbar Basha KM.

Attachment: SyncfusionMvcApplication3_743b9ae9.zip

RA Raja October 30, 2014 09:25 AM UTC

Thanks for your attachment and explanation, its working in the sample and now i will figure out what is different in my project.

AB Akbar Basha K M Syncfusion Team October 31, 2014 07:41 AM UTC

Hi Raja,

Thanks for your update. Please let us know if you have any concern.

Akbar Basha KM.

Live Chat Icon For mobile
Up arrow icon