ASP.NET MVC Scaffolding
3 Feb 20213 minutes to read
Syncfusion provides Visual Studio Scaffolding for Syncfusion ASP.NET MVC platform to quickly add code that interacts with data models and reduce the amount of time to develop with data operation in your project. Scaffolding provides an easier way to create Views and Controller action methods for Syncfusion ASP.NET MVC DataGrid, Charts, Scheduler, Diagram, Tree Grid, Rich Text Editor, Document Editor, and PDF Viewer controls.
The Syncfusion ASP.NET MVC UI Scaffolder is available from v220.127.116.11.
Add a scaffolded item
The following steps explain how to add a scaffolded item to your ASP.NET MVC Web application:
Before use, the Syncfusion ASP.NET MVC Scaffolding, check whether the ASP.NET MVC Extensions - Syncfusion installed or not in Visual Studio Extension Manager by clicking on the Tools -> Extensions and Updates -> Installed for Visual Studio 2017 or lower and for Visual Studio 2019 by clicking on the Extensions -> Manage Extensions -> Installed.
Right-click the Controllers folder in the Solution Explorer, click Add, and then select New Scaffolded Item.
In the Add Scaffold dialog, select Syncfusion ASP.NET MVC UI Scaffolder, and then click ‘Add’.
In the Syncfusion UI Scaffolding dialog, select the desired control to perform scaffolding, and then click Next.
Syncfusion UI Scaffolding for the selected control dialog will be opened. Enter the Controller Name and View Name as application requirements, and then select the required Model Class of the active project and its relevant Data Context Class, and then click Next.
Syncfusion UI Scaffolding for the selected control feature dialog will be opened. Select the required features, update the required data field, and then click Add. Use the back arrow if you want to modify the already provided controller name or view name and the selected Model Class and Data Context Class.
The Controller and the corresponding View files are now generated with the selected features of Syncfusion control code snippet.
Ensure that at least one Entity Framework model exists, and the application has been compiled once.If no Entity Framework model exist in your application, refer to this documentation to generate the Entity Framework model. After the model file has been added, ensure that the required DBContext and properties have been added. Now, build the application, and try scaffolding. If any changes have been done in the model properties, rebuild the application once before perform scaffolding.
If you installed the trial setup or NuGet packages from nuget.org you have to register the Syncfusion license key to your project since Syncfusion introduced the licensing system from 2018 Volume 2 (v18.104.22.168) Essential Studio release. Navigate to the help topic to generate and register the Syncfusion license key to your project. Refer to this blog post for understanding the licensing changes introduced in Essential Studio.
How to render Syncfusion control?
Refer to the following UG links to render Syncfusion control after performed scaffolding.