How to avoid the exception "does not contain a definition for 'EJ' and no extension method 'EJ'"?
Problem
While rendering Syncfusion controls, the following error is obtained - “Does not contain a definition for 'EJ' and no extension method 'EJ'” in ASP.NET MVC.
Reason
When EJ namespace is not referred properly in the sample, EJ Undefined error is occurred.
Solution
To resolve this issue, add the following namespace code example to web.config file.
web.config
<pages> <namespaces> <add namespace="Syncfusion.JavaScript"/> <add namespace="Syncfusion.MVC.EJ"/> </namespaces> </pages> |
Note:
You need to add the above namespace in the root web.config file present in the application and another web.config file present in the Application -> Views Folder -> web.config file.
I hope you enjoyed learning on how to avoid the exception for 'EJ' in ASP.NET MVC controls.
You can refer to our ASP.NET MVC feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our ASP.NET MVC example to understand how to create and manipulate data.