Behrooz
Behrooz

Reputation: 1955

Using SyncFusion controls in Asp.Net MVC

I am a new user of your component library and after a few days of trying really hard, I am quite frustrated by not being able to use Syncfusion controls on an ordinary ASP.NET MVC Project. I am using Visual Studio 2013 to develop ASP.NET MVC 5 Apps which can benefot from SyncFusion components, however, I haven't found a way to do it without losing a part of functionality in the project.

  1. I tried creating an ASP.NET MVC project in VS2013, right clicking on it and converting it to SyncFusion, it allows me to use some components like RTE but for example a very simple Grid that is supposed to be bound to a Model (which itself is an IEnumerable) simply doesn't work and constantly says the Model is empty (while it is not).

  2. I tried creating an app initially using the SyncFusion Template added to the Visual Studio, but I realized the structure of the app is different from the orginial ASP.NET MVC App that Microsoft has equipped in the VS, and for various reason I do not want a modified version.

  3. I tried reating an ASP.NET MVC project in VS2013, and installing SyncFusion MVC using the NuGet, the grid works, the RTE doesn't.... Do you guys have a real simple and comprehensive guide, on how to just use SyncFusion controls on an ordinary MVC app, successfully?

Upvotes: 0

Views: 2863

Answers (1)

user3610920
user3610920

Reputation: 1642

Please find solution for your queries here,

  1. Syncfusion Conversion add-in does not add any sample snippets into the target project. Also, we don’t add the Syncfusion Model related files while converting a project with Grid control. Syncfusion project Conversion add-in will add the required Syncfusion References, Scripts and CSS and this is included in your ASP.NET MVC project. Please refer the images named CSS and Scripts and References from the hyper link named Images for more information. So you need to include the control integration part manually because no snippet will be added to your project while using Syncfusion MVC Conversion. After converting the project to Syncfusion MVC project, you need to do the following things,

    • Add required snippets in Controller, View, and Model if required. Refer the Themes and script files path in _Layout .cshtml/_Layout .vbhtml file. Please refer the image named Layout from the hyper link named Images for more information.

    • Run your sample and it will render the Syncfusion controls properly.

If you need to create a sample with Code snippets you can use the Syncfusion Sample Creator. Please follow the below steps to create the Syncfusion MVC Samples with code snippets.

  • Launch Dashboard and Choose ASP.NET MVC platform. You can find the SAMPLE CREATOR Button from Dashboard. Please refer the image named Sample creator 1 from the hyper link named Images for more information.

  • Click the SAMPLE CREATOR button. The Sample Creator window will be
    opened. Now you can create the Syncfusion MVC samples based on your
    options. Please refer the image project creation form sample creator from the hyper link named Images for more information

.

  • In additionally we can use the Sample Creator in Visual Studio
    itself. By choosing Add Samples option in Syncfusion ASP.NET MVC
    project templates we can add the code snippets in that project.
    Please refer the image named project creation from VS from the hyper link named Images more information.

Note: For your reference you can create the grid control samples using the Syncfusion Sample creator. This may be useful to know about the Grid related issue in your sample. Please refer the images from below link.

Images

  1. The Syncfusion MVC project templates are implemented from default Microsoft MVC templates. In additionally the Syncfusion References, CSS and Script files and web.config entries were added while project creation for use the Syncfusion Controls in that project.

Upvotes: 1

Related Questions