When you create a new application using the ComponentOne MVC template, the resources required to use the C1 MVC controls get registered automatically. But, you need to register resources manually in case you want to use any ASP.NET MVC Edition control in an existing application or create a project using standard Visual Studio templates.
Complete the following steps to register the required resources for using ASP.NET MVC Edition controls:
<head></head>
tags. This step will register all the MVC controls used in your application, except FinancialChart, FlexSheet, MultiRow, FlexViewer, OLAP, TransposedGrid, and TransposedMultiRow controls.
Razor |
Copy Code
|
---|---|
@Html.C1().Styles() @Html.C1().Scripts().Basic() |
_Layout.cshtml
if you want to use any specific control such as FinancialChart, FlexSheet, MultiRow, FlexViewer, OLAP, TransposedGrid, and TransposedMultiRow controls in your application. You can add or remove the controls depending upon your project requirements.
Razor |
Copy Code
|
---|---|
@Html.C1().Styles() @Html.C1().Scripts().Basic().Finance().FlexSheet().FlexViewer().Olap().MultiRow().TransposedGrid().TransposedMultiRow() |
ASP.NET MVC Edition supports conditional resource registration. Wherein, you may register only the resources that you wish to use in your application to keep your application lighter. The list of controls which support conditional resource registration is as follows:
For example, the following code registers the conditional resources required to use FlexGrid and FlexChart.
Razor |
Copy Code
|
---|---|
@Html.C1().Scripts().Basic(b=>b.Grid().Chart()) |
Similarly, you can also register the conditional resources required to use CollectionView, Input and Gauge.