How to add Dot Net Dash to an MVC view

You can add Dot Net Dash onto an MVC view with just two lines of markup. Shown here is the complete markup to render the control in an Mvc view:

Sample code

Dot Net Dash is built on ASP.Net MVC 2

If you are using an older version of Microsoft's MVC libraries, please contact us for help.

3 Easy Steps

Step 1 - Add a project reference to the QualityData Web Management Assembly

On the Visual Studio Project Menu, select "Add Reference..." then browse to QualityData.Web.Management.dll which can be found in your installation directory (usually c:\program files\Quality Data\DotNetDash.)

Step 2 - Add the Imports Page Directive then build your project

At the top of your View (or partial view), just below the @Page directive, add an @Import directive like this:

<%@ Import ="QualityData.Web.UI" %>

This will register the AjaxDashboard Html extension method and enable intellisense for the next step. Remember to build your project before the next step.

Step 3 - Add the markup for the control

Add the following into the page where you would like the control to render:

<% = Html.DotNetDash("Administrators").ConnectionStringName("ApplicationServices") %>

...where "Administrators" is the role that should be granted access to the control and "ApplicationServices" is the name of the connection string to your membership database. If you are using a version of the .Net Framework prior to 4.0, the default providers may use the connection string named "LocalSqlServer" instead.

Through intellisense, you can see other available options. Just append a "dot" at the end. For example:

...ConnectionStringName("ApplicationServices").AppTitle("My Custom Title")

This is known as a Fluent Html Helper.

You should now be able to run your project to see Dot Net Dash in your MVC View.

Quick Links

Free download
Asp.Net Admin Tools
Asp.Net Membership and Roles Administration tool

Did you know?

Dot Net Dash gives you instant management of your Asp.Net web applications.