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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:

Created:

Updated:

Platform:

Replies:

117477 Oct 28,2014 02:15 PM UTC Oct 31,2014 07:41 AM UTC ASP.NET MVC 3
loading
Tags: Chart
Raja
Asked On October 28, 2014 02:15 PM UTC


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
http://help.syncfusion.com/ug/asp.net%20mvc/default.htm#!documents/chartmodel33.htm

i am referencing all of the dlls listed here
Syncfusion.Core.dll
Syncfusion.Chart.Mvc.dll
Syncfusion.Chart.Base.dll
Syncfusion.Compression.Base.dll
Syncfusion.DocIO.Mvc.dll
Syncfusion.Linq.Base.dll
Syncfusion.Shared.Mvc.dll
Syncfusion.Shared.Base.dll
Syncfusion.PdfIO.Mvc.dll
Syncfusion.XlsIO.Base.dll
AjaxMin.dll
Syncfusion.Theme.Base.dll

i am using asp.net MVC 4.0


Please give solution for the missing reference.




Attachment: error_80ae9487.zip

Akbar Basha K M [Syncfusion]
Replied On 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

[web.config]

<code>      

<assemblies>

      

        <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" />

      </assemblies>

<namespaces>

        <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" />

</namespaces>

</code>

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.

http://help.syncfusion.com/ug/asp.net%20mvc/default.htm#!documents/addcodestothewebconf.htm

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.

http://help.syncfusion.com/ug/asp.net%20mvc/default.htm#!documents/addstylemanager.htm

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

http://help.syncfusion.com/ug/asp.net%20mvc/default.htm#!documents/addscriptmanager.htm

We have prepared a simple sample based on your requirement.

Please find the attached sample.

Please let us know if you have any concern.

Regards,

Akbar Basha KM.


Attachment: SyncfusionMvcApplication3_743b9ae9.zip

Raja
Replied On 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.

Akbar Basha K M [Syncfusion]
Replied On October 31, 2014 07:41 AM UTC

Hi Raja,

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

Regards,
Akbar Basha KM.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;