How to add Dot Net Dash to a WebForms Application

Dot Net Dash is a control, just like the other controls you already have in your Visual Studio Toolbox.

If you choose to add Dot Net Dash to your toolbox, you can simply drag and drop it onto a web form and set a couple required properties in the designer. Alternatively, you can manually add a project reference to Dot Net Dash and enter a couple of lines of markup as shown below.

Sample code

Shown here is a complete web form that renders the Dot Net Dash control. As illustrated, the control is configured to restrict access to members of the Administrator role and also to use the connection string named LocalSqlServer to access the membership database tables.

Dot Net Dash leverages the Microsoft Asp.Net MVC Framework to implement its server-side (REST) API and therefore requires version 3.5 SP1 of the .Net Framework and the assembly System.Web.Mvc.dll which can be simply dropped into the bin folder of your web application. If you're using a version of the .Net Framework prior to 4.0, the "UrlRoutingModule" must also be registered in your application's web.config file as shown below:

configuration file

The configuration file shown here actually includes everything needed to run Dot Net Dash with default membership providers and connection string. As highlighted, the UrlRoutingModule should be registered within the httpModules section of system.web (within system.webserver on IIS7.)

Using the .Net 4.0 Framework?

If you are using version 4.0 (or later) of the .Net Framework, it is no longer necessary to register the Url Routing Module since it is built-in. Just skip Step 3 below!

The following steps provide instructions for getting Dot Net Dash to work with your web forms application.

3 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 Register Page Directive and control markup to your web form

At the top of your web form, in Source View, just below the @Page directive, add a @Register directive like this:

<%@ Register ="QualityData.Web.Management" ="QualityData.Web.UI"="qd" %>

In the body of the page, where you would like the control to render, add the following markup (note that intellisense will help you once you type "<qd".)

<qd:DotNetDash ="Administrators" ="LocalSqlServer" ="server" ="dash" />

...where "Administrators" is the role that should be granted access to the control and "LocalSqlServer" is the name of the connection string to your membership database.

Step 3 - Configure your web application to support routing

This step is only necessary if you're using a version of the .Net Framework prior to 4.0.  In your application's web.config file, within the "httpModules" element of system.web, add the following:

<add ="UrlRoutingModule" ="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

You should now be able to run your project to see Dot Net Dash on your web form.

Notes

If youare using a version of the .Net Framework prior to 4.0, remember to install Microsof't MVC or simply include System.Web.Mvc.dll in your application's bin folder.  Starting with version 4.0, the MVC libraries are now built in.

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.