Introducing the ASP.NET Web Matrix

“Unfortunately, no one can tell you what the Matrix is. You have to see it for yourself.”  But seriously, this article is an introduction and overview to the Microsoft ASP.NET Web Matrix Project, although this is an application that you should see to really appreciate.

Contributed by
Rating: 4 stars4 stars4 stars4 stars4 stars / 10
August 15, 2005
Rate this Article:
MEH MEH++


SEARCH ASP FREE
TOOLS YOU CAN USE

advertisement

In a nutshell, the Web Matrix it is a complete ASP.NET application development environment that can be used to create anything from individual HTML or ASP.NET pages, to complex web services and end-to-end applications.

It is still just in release 0.6 and is literally a project undertaken by some members of the ASP.NET team in their spare time. It is an experiment, and what the development team hope will be a two-way process of interaction between developers. The team has set up a kind of bartering system of us telling them what we want and them building it into future releases. Using the Public as elements of your UAT (User Acceptance Testing) and QA (Quality Assessment) phase in this way is an excellent idea as you are never going to artificially create a control group as diverse and as brutally honest as the developer and user community as a whole.

There are apparently still some bugs in the current release, and parts of the application behave a little differently from what some of the online documentation states, but I haven’t seen any major problems yet. It is basically a fully working, yet completely free application.

Users of Visual Studio will feel very much at home when using the Web Matrix, as it is very similar in look and feel to Microsoft’s application development suite; in fact, it could almost be just an extra profile within Visual Studio. It is as if the developers took all of the ASP.NET related features from Visual Studio, then added a whole load of extra related functionality and packaged it up into a separate application.  That is how good it is.

Application Workspace

The Web Matrix is produced to a very high visual standard; it looks great and is laid out in an intuitive and easy to use format. The application workspace is set up to be as efficient as possible, and give developers the tools they need at their fingertips. 

The toolbox is split into different categories of tools that relate to specific tasks. The main document window contains tabs that show up to allow four different views, depending on the type of document you are editing. An ASP.NET page, for example, can be viewed in design mode, where elements are laid out and edited visually; an HTML view that lets you edit the HTML code directly; a code view that handles just the script code; and finally an "all view" that puts the HTML and code views together on the page. A CSS page, naturally, will show only the code view.

Documents in all of these views (except the design view) show syntax highlighting. Unlike Visual Studio however, there is no code completion engine. (Please note: the program neither intends nor claims to be Visual Studio. This is just what I am comparing it against due to the similarities and power inherent in both). Surprisingly enough there is no line numbering facility, although if enough developers request this, it is sure to appear in later releases.

The workspace panel gives you Explorer style access to your local files, enabling you to quickly browse to and open files involved in your projects. 

The data view shows database connections you have set up or allows you to connect to new databases through the completion of a simple wizard-style interface.

The window pane simply lists all open windows, but it is a quick and easy way to navigate between open documents.

The properties panel, again, is very similar in working to the properties panel of Visual Studio. It lets you view and edit the properties of any selected element from labels to the document itself. The ability to select multiple elements on the design page at once allows you to easily roll out settings to groups of related elements.

The class viewer lists every available class, and can be organized and sorted in a variety of ways. Double-clicking a class will bring up an information window detailing the properties, methods and events, among other things associated with the class. 

The community tab provides links to a vast array of online documentation regarding ASP.NET in the form of websites, forums and newsgroups. Windows Messenger has also been integrated into the application and can show a list of all your contacts in the ASP.NET contacts group.

Testing Your Pages, Database Server

When working on your ASP.NET scripts, you are going to want to periodically test that the pages work in the manner you intend. If you have IIS installed you can save files in your Inetpub folder and view them through your browser manually, but the Web Matrix can automate this process for you and have a virtual root created by IIS in which to store your pages; the browser is then launched and the page is viewed automatically. If you don’t have IIS installed, don’t worry because the Matrix ships with its own fully integrated personal web server specifically for viewing the pages you create! All this can be achieved simply by pressing the play button on the toolbar.

One thing the application doesn’t have integrated with it is a database server for use with the data page templates. This in itself does not provide too much of a challenge, however, because the Web Matrix contains full information on how to download and install the Microsoft Desktop Engine, a lightweight database server that allows you to view, retrieve and modify data stored in SQL databases. This is another application that is provided by Microsoft completely free of charge.

Some of the information you need to install the Microsoft Desktop Engine is online rather than in the program help files (in fact, the help files themselves are online), and you will need to venture into a command prompt to fully install the database server, but it is well documented and I’m sure it could be installed fairly easily by somebody who had never even used a database server before. If you would rather use an Access database instead, the Web Matrix provides a built in method of doing this too, and uses a step-by-step wizard to create either type of database and connect to it for you.

In addition to connecting to databases, the Web Matrix also provides a model for editing the data held within your database table(s) or editing the structure of the table(s). This provides an easy method for managing the data that is held.

Browsers, Templates, and Wizards

Bundled with the application is also the Matrix Class browser, which acts a little like the class panel in the main application and allows you to fully explore the available classes that make up the .NET Framework. The main benefit of having this as a separate component of the Web Matrix is that it allows you to have the class information you need at your fingertips without cluttering your design workspace. Need to know which namespace to import in order to use the CrystalReports classes? Simply look it up in the class browser, and while you’re there, you can easily see which methods can be exposed, the properties that can be set and which events can be captured when working with objects derived from it.

There are a whole host of templates that can be used to create a range of different page types from basic ASP.NET, HTML and CSS pages, to complex data reports and web services.

Code wizards are provided that help you to construct the correct functions for several database related tasks such as viewing, adding, removing and updating data from data sources. For example, in order to set up a database used to store customer names and email addresses, and provide a method for these details to be saved in the database, you can simply carry out the following tasks:

  • Select the Data panel and click the Add Database Connection button.
  • Select the MSDE database and then click the Create a new Database link. 
  • Enter the name customers and click OK. This will add the connection. 
  • Expand the new connection in the Data Panel connections window and select the tables folder, then on the Data panel toolbar, select the New Database Object button. 
  • Enter the name custInfo and click OK. You should now be presented with the table dialog. 
  • In design mode, select Column0 and use the properties box to set its name to firstName and the Data Type to text. Now add two more columns and configure them as shown below.

Now create a new ASP.NET page and, in the design view, drag three labels and three text boxes onto the page from the web controls toolset. Format them appropriately so that they appear as below, and add a button at the bottom.

You can use the properties panel at the side of the workspace to set the names and values of the labels, the text boxes and the button.  Once this is done, switch to Code view and drag the INSERT Data Method onto the page. The Insert Data Code Wizard will appear; ensure that (local).customers appears in the drop-down box and click Next.  Nothing needs to be done on the next page so simply click Next again, then on the final page of the wizard, enter the name of the function as addCustomer. Upon clicking finish, the application will generate almost all of the necessary code to make the page work; all you need to do now is tie the button to the INSERT method. Go back to the design view and double-click the button; this will add the appropriate event to the code view, which you will now need to go back to. Within the button event Sub, add the following code:

  addCustomer(txtFname.Text, txtLname.Text, txtEmail.Text)

Now save the page and click the play button.  The page will load, so enter some information into it and hit the submit button. Close the page now and double-click custInfo table in the Data panel of the Web Matrix. Your table should appear. Switch it to the Data view and the code you entered should have been added to the database. This is a basic example, but it goes to show just how easy it is to create functional applications in little time. You can see how easy it would be to create something like a product catalogue or forum registration page using these built in code wizards.

Conclusion

For developers looking to move into the ASP.NET field, the Web Matrix is an excellent place to start. There are some excellent walk-through guides that talk you through some ASP.NET basics and at the same time give you a working experience in using the program itself. As explained earlier, the community panel gives you instant access to a wealth of information on the use of ASP.NET. Additionally, when you come across useful bits of code, this code can be dragged into the "my snippets" area of the toolbox for reuse in future projects. Code added here is concealed within the sub or function name until the pointer is rolled over it; at that point, it expands in a tooltip style to show you the full code.

The toolbox can be enhanced further with the addition of custom controls that can be downloaded from the online component gallery.  When an appropriate control has been found, it is downloaded and installed to the Global Assembly Cache. The GAC is a part of the .NET framework that is used as a registry of installed components, to which the Web Matrix has full access. The online gallery is apparently updated on a regular basis.

All in all, this is an excellent application that brings everything a beginner or advanced ASP.NET developer could want into one workspace. I don’t want to sound biased towards Microsoft as although they did not officially create it, they do own the license to it, but I believe in giving credit where credit is due. For those that don’t want to shell out for a copy of Visual Studio but want an intelligent IDE to ease their web application development, they could do a lot worse than giving the Web Matrix a try.

blog comments powered by Disqus
.NET ARTICLES

- .Net 4.5 Brings Changes
- Understanding Events in VB.NET
- Objects, Properties, Events and Methods in V...
- Install Visual Web Developer Express 2010
- Microsoft Gadgeteer an Open Source Alternati...
- Best DotNetNuke Modules
- Facebook Image Viewer in Visual Basic
- Murach`s ADO.NET 4 Database Programming with...
- 5 Must Have Visual Studio 2010 Extensions
- Dynamic Web Applications with ASP.NET Mono u...
- PDFSharp: HTML to PDF in ASP.NET 3.5 using V...
- Using the PDFSharp Library in ASP.NET 3.5 wi...
- Sending Email in ASP.NET 3.5 using VB.NET wi...
- ASP.NET 3.5 Role Based Security and User Aut...
- Creating ASP.NET Login Web Pages and Basic C...

ASP Web Hosting ASP.Net Web Hosting Windows Web Hosting
ASP Free Forums 
 RSS  Tutorials RSS
 RSS  Forums RSS
 RSS  All Feeds
Site Map 
Request Media Kit
Write For Us Get Paid 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Privacy Policy 
Support 


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 11 - Follow our Sitemap
Most Popular Topics
All ASP.Net Tutorials