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

version 12.1.0.43 ASP.NET MVC Product and default Grid adding to existing project

I am using this example
http://mvc.syncfusion.com/demos/web/Grid/Default

and the sample project provided with the download of your ASP.NET MVC trial product.

I tried manually adding the references that I guess it needs to an existing project because I can't find the Visual Studio extension to convert my project (had a previous uninstalled trial for v11 and I am not sure if this is even available for v12 yet because your help documents are also not yet available)

When I try using a very basic example grid with some local data, I get a javascript error of ej reference not found... is there a dependency on your separate Essential Javascript library product that I am not aware of?

I also tried removing the reference to ej/ej.web.all.min.js in the same project and the default grid example no longer works...

Anyone got any ideas how I can install the correct SyncFusion DLLs to an existing project and get a simple grid example at least working?
I wasn't expecting to have to pay for both ASP.NET MVC and Javascript products.

6 Replies

NE Neil May 17, 2014 12:54 PM UTC

"all.min.js in the same project"... is meant to say "in the sample project"


NE Neil May 17, 2014 02:28 PM UTC

I also can't find any way to get a trial key for version 11 of the ASP.NET MVC product, I wanted to use that because you have help documents available for it.. seems I can't


NE Neil May 18, 2014 01:05 PM UTC

Attaching a basic ASP.NET MVC4 C# solution with the changes I made to try and get this grid example working.

I used the same js, css from the sample project and referenced DLLs in C:\Program Files (x86)\Syncfusion\Essential Studio\12.1.0.43\Assemblies\4.0\ and C:\Program Files (x86)\Syncfusion\Essential Studio\12.1.0.43\Assemblies\MVC\MVC4\ 

which is the same as what the SyncFusion example solution is doing..

The only difference is in this attached solution I am using v2.1.1 of JQuery, but that is not the issue because I upgraded JQuery in the SyncFusion example project and it still works fine.

In my attached example the grid currently adds some javascript to try and do dome data- attribute binding and then doesn't do anything else.

The SyncFusion sample project does something completely different and works and I can't see why?

Any help would be appreciated.

Attachment: SyncFusionExample_23b7ad9a.zip


MK Maithiliy K Syncfusion Team May 19, 2014 12:51 PM UTC

Hi Neil,

Thanks for using Syncfusion products.

We have checked the sample that you have attached and suspect that the cause of the issue is you have enabled “Unobtrusive” mode in Web.Config file and missed to add “ej.unobtrusive.min.js” script in the _Layout.cshtml page hence the MVC Grid is not rendered. Please refer the below code snippet.

[Web.config]

 

<appSettings>

    <add key="webpages:Version" value="2.0.0.0" />

    <add key="webpages:Enabled" value="false" />

    <add key="PreserveLoginUrl" value="true" />

    <add key="ClientValidationEnabled" value="true" />

    <add key="UnobtrusiveJavaScriptEnabled" value="true" />

</appSettings>

If UnobtrusiveJavaScriptEnabled is set as true then we must include the “ej.unobtrusive.min.js” file in the _Layout.cshtml page. Please refer the below code snippet.

[_Layout.cshtml]

 

<script src="@Url.Content("~/Scripts/ej/ej.web.all.min.js")"></script>

<script src="@Url.Content("~/Scripts/ej/ej.unobtrusive.min.js")"></script>

We have drafted the documentation for the ASP.Net MVC controls and it is tentatively scheduled to be hosted online on May 21, 2014. We will let you know once the documentation is hosted online. For now we have provided the Unedited documentation copy of the Getting Started ASP.Net MVC Grid control and the same can be downloaded from the below link.

Document link: http://www.syncfusion.com/downloads/support/directtrac/125032/Getting_Started_for_MVC_Grid-577428159.zip

We have listed the Namespaces, DLLs , script and CSS files needed to work with the ASP.Net MVC Control in the below table. Please refer the below table.

DLLs required

Syncfusion.EJ.dll

Syncfusion.EJ.MVC.dll

Syncfusion.Core.dll

Namespaces

Syncfusion.MVC.EJ

Syncfusion.JavaScript

Script files

Syncfusion script files:

ej.web.all.min.js

ej.unobtrusive.min.js  // need only when UnobtrusiveJavaScriptEnabled is set as true in web.config file

External Script files:

jquery.min.js

jquery.easing.min.js

jquery.globalize.min.js

jsrender.min.js

jquery.validate.min.js

CSS files

ej.widgets.all.min.css

For your convenience we have created a getting started video for ASP.Net MVC Grid control and the same can be downloaded from the following location.

Video Link: aspmvc.zip

In the above video we have used the MVC Extension to create Syncfusion ASP.Net MVC Grid control. Please find the latest MVC Extension setup from the below link.

http://www.syncfusion.com/downloads/extension/v12.1.0.43

For your convenience, we have modified the sample that you have attached and the same can be downloaded from the attachment.

Please let us know if you have any queries.

Regards,

Maithiliy K


Attachment: SyncFusionExample_a9005e24.zip


NE Neil May 19, 2014 01:39 PM UTC

Thank you that was very helpful.

I wasn't aware of the new SyncFusion project template that was added to my Visual Studio, so that would have saved me a lot of time.. thanks for the video showing that.

The default MVC4 Visual Studio 2012 template was what set UnobtrusiveJavascript to be enabled so I have now disabled that and the Grid works, thanks.

It worked without having to add the ej.unobtrusive.min.js file, is there any documentation on what changes this makes? 




MS Madhu Sudhanan P Syncfusion Team May 20, 2014 12:33 PM UTC

 

Hi Neil,

 

Thanks for your appreciation.

 

We don’t have any documentation for Unobtrusive JavaScript mode in ASP.Net MVC Controls.

 

When the “UnobtrusiveJavaScriptEnabled” is set as true in web.config file, the control container will be generated using HTML5 “data” attributes and we need to refer the “ej.unobtrusive.min.js” script file in the view page to render the Essential Javascript controls in unobtrusive mode.

 

For more details about Unobtrusive Javascript please refer the below links.

 

http://blog.socialcast.com/unobtrusive-javascript-2/

 

http://simonecarletti.com/blog/2010/06/unobtrusive-javascript-technique/

 

Please let us know if you have any queries.

 

Regards,

Madhu Sudhanan. P


Loader.
Live Chat Icon For mobile
Up arrow icon