Fluent Html Helper

One of our key goals when we designed Dot Net Dash was to make it easy to implement on your web site. If you are using Web Forms, the Visual Studio designer provides intellisense to help you set properties in Source View and the Properties Panel gives you a rich UI. If you are adding Dot Net Dash to an MVC view, you have the option of using our HTML Helper to site the control and set its properties.

Mvc Html helper methods

As illustrated here, the Html Helper method, "Html.DotNetDash()" is available with full intellisense once you have imported the namespace that includes the DotNetDash control. On an MVC view, when you type in <%=Html.DotNetDash(, you'll see that the roles string is a required parameter.

Technically, the only required parameter for Dot Net Dash is a string that defines the roles which should be allowed to log into the control and to access the REST API. If you want to specify the connection string, title or other properties, however, you can add a period (".") after the closing parenthesis to display a list of additional options.

Mvc Html helper options

This approach to setting properties by appending additional methods to the previous result is known as a "Fluent Html Interface". Contrast this with an approach where you have multiple overloaded constructor methods and you can see the benefits in its simplicity. There's a lot of debate on the Internet about the pros and cons of each approach but since we plan on adding additional properties over time, we elected to go the fluent route.

Setting numerous properties

As illustrated here, you can set various properties by simply appending the period and method name for each option. As you do so, intellisense is available to help you enter required option parameters.

The properties illustrated here include:

  • ConnectionStringName - Recommended. Should match that of your membership provider.
  • Height - Optional. You could also place the control in a container element to have it fill the page.
  • Width - Optional. The parameter requires a "Unit" which can be expressed as a percentage.
  • AppTitle - Optional. Lets you replace the text displayed at the top left of the Application.

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.