dashboard-116313-get-started-build-web-dashboard-applications-create-an-aspnet-mvc-dashboard-application.md
This tutorial describes how to integrate the ASP.NET MVC Dashboard extension into an ASP.NET MVC web application.
This section describes how to create an MVC application in the DevExpress Template Gallery.
In Visual Studio, create a new project and select DevExpress v25.2 Web App Template Gallery on the start page as the project template.
In the invoked gallery, go to the ASP.NET MVC category and select Web Application. Enter MvcDashboardApp as a project name and click Run Wizard.
In the opened ASP.NET MVC Project Wizard, select Empty on the Layout tab.
Then, go to the Suites tab and enable only the Dashboard checkbox to attach the Web Dashboard’s stylesheets, scripts, and resources. Click Create Project.
Build the solution.
Open the Views | Home | Index.cshtml (or Index.vbhtml ) view, right-click the desired location in the Code Editor to display a context menu and click Insert DevExpress MVC Extension… to invoke the Insert DevExpress Extension wizard.
In the Insert DevExpress Extension wizard, go to the Visualization tab, select Dashboard and click Insert.
Right-click the App_Data folder and add the Dashboards folder.
In the DashboardConfig.cs file located in the App_Start folder, uncomment the DashboardConfigurator.SetDashboardStorage method call and change the dashboard storage path to ~/App_Data/Dashboards.
Add the nwind.mdb file from the following path to the project’s App_Data folder:
Specify a connection string to this database within the project’s Web.config file:
In the DashboardConfig.cs file (located in the App_Start folder), pass the ConfigFileConnectionStringsProvider instance as the DashboardConfigurator.SetConnectionStringsProvider method’s parameter to allow a user to create new data sources based on connection strings from the Web.config file:
You can now create your first dashboard in the Web Dashboard.
In Designer mode, the control loads the extensions required to design dashboards. Users can access the Data Source Wizard , preview underlying data, and modify dashboards from storage. Requests from the dashboard backend server can be sent to third-party resources. A user can also switch the control to Viewer mode.
After you created and saved a dashboard, switch your Dashboard Designer application to ViewerOnly mode to prevent users from modifying the dashboard and its data.
In a project, open the Views | Home | Index.cshtml (or Index.vbhtml ) view. Add the following code within the MvcDashboardFactory.Dashboard helper method:
Run the application. The ASP.NET MVC Dashboard extension displays the dashboard from ~/App_Data/Dashboards in Viewer mode:
Create Dashboards on the WebDescribes how to create and configure dashboards in the Web Dashboard control.ASP.NET MVC Dashboard ExtensionContains instructions on how to integrate the DashboardExtension extension into an ASP.NET MVC application. See Also
Web Dashboard Technical Overview