Video: Configuring an MVC App Using a Standard Visual Studio Template

In this video, we'll walk you through setting up an ASP.NET MVC application using a standard Visual Studio Template.

  1. From File->New project, create a new project using ASP.NET Web Application template.
  2. In the new ASP.NET Web Application wizard, select MVC and click OK.
  3. Next, right click References node under Solution Explorer, select Add reference.
  4. In the Reference Manager, click Browse.
  5. Go to the bin folder of ASP.Net MVC Edition under Program Files X86/ComponentOne
  6. Select and add C1.Web.Mvc dll. It is recommended that the Copy Local property for this reference is set to true.
  7. Next we will add licensing for ComponentOne controls to the project.
  8. Right Click the Project and select Add text file from context menu.
  9. Name the file Licenses.licx.
  10. Enter "C1.Web.Mvc.LicenseDetector, C1.Web.Mvc" to the file.
  11. Save and close the file.
  12. Next, open the web.config file under Views folder.
  13. Add the C1.Web.MVC and C1.Web.Mvc.Fluent namespaces to the pages node under System.web.webpages.razor. This will enable Intellisense for ComponentOne controls.
  14. Now we need to register the resources i.e. JS, CSS for the controls.
  15. Open, _Layout.cshtml file under Views/Shared.
  16. Inside the head tag enter @Html.C1().Styles() to register CSS.
  17. Add @Html.C1().Scripts().Basic() to register the JavaScript resources.
  18. Now the project is ready to use any ComponentOne control that is part of C1.Web.Mvc dll.
  19. Let’s add a control to the Index.cshtml under Views/Home folder to verify the settings.
  20. Declare a ComponentOne Calendar control using Html Helpers and run the project.
  21. A functional Calendar is displayed. This verifies that the project is ready to use any ComponentOne control.


GrapeCity Developer Tools
comments powered by Disqus