Hello,
I integrated Syncfusion ASP.NET MVC (13.1.0.21) in an existing MVC5 (.net 4.5.1) project
i used the Assemblies version "13.1451.0.21 " of Syncfusion
i'm calling a Grind in my view, but each time an exception is triggered :
An exception of type 'System.NullReferenceException' occurred in Syncfusion.EJ.dll but was not handled in user code
Additional information: Object reference not set to an instance of an object.
Here my VIEW code :
@(Html.EJ().Grid("VehiculesGrid")
.Datasource((IEnumerable)Model) // i tested with ViewBag.datasource ( same exception )
.AllowSorting()
.AllowPaging()
.Columns(col =>
{
col.Field("Marque").HeaderText("Marque").Width(80).Add(); //The EXCEPTION occurs in this line
}))
my Controller code contain this in an ActionResult method :
var vehicule = db.Vehicule.Include(v => v.Designation); // This returns a list of Objects of type
return View(vehicule.ToList());
// i tried this too ( and it still not working )
var v1 = new Vehicule() {Marque = "test"};
List<Vehicule> vList = new List<Vehicule>();
vdd.Add(vList );
ViewBag.datasource = vList.ToList();
May the problem is my way of integrating the Syncfution to my existing project ?
My method :
I created a new Syncfusion MVC5 project (// The Syncfusion use the .NET 4.5 & my project use the .NET 4.5.1)
and then i copied everything related to syncfusion to my Web.Config and i changed Vestion=13.1450.0.21 to 13.1451.0.21
ex. <add assembly="Syncfusion.EJ, Version=13.1451.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" />
i changed my Layout page & i copied the content & the script
i'm not sure about this part that i add in my web.config file
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules>
<remove name="FormsAuthenticationModule" />
</modules>
<handlers>
<remove name="MvcResourceHandler" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
<add verb="*" path="captimage.axd" name="syncfusion_generatetools" type="Syncfusion.JavaScript.ImageHandler, Syncfusion.EJ, Version=13.1451.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>