WindowsDevCenter.com
oreilly.comSafari Books Online.Conferences.

advertisement


AddThis Social Bookmark Button

Introducing ASP.NET Web Matrix
Pages: 1, 2, 3, 4, 5

You can now search for books from Amazon.com!


Figure 11. Testing the application

Customizing ASP.NET Web Matrix

One of the cool features of ASP.NET Web Matrix is its ability to add new components online. To add an online component, simply right-click on the toolbox and select Add Online Toolbox Components.... The Component Gallery lets you browse for components and controls online, and download them to your local machine.


Figure 12. Adding online toolbox components

Online components are grouped into categories. Select the catagory you want and see if there are any controls available. Installing a component to your ASP.NET Web Matrix is then a matter of clicking on the Install button.


Figure 13. Adding a new online component

Besides adding online components from the Web, ASP.NET Web Matrix also allows you to add commonly-used templates into the editor. You customize the templates using the WebMatrix.exe.config file. This file is found in the installation directory of ASP.NET Web Matrix, typically in c:\Program Files\Microsoft ASP.NET Web Matrix\v0.5.464\. (v0.5.464 is the build number of ASP.NET Web Matrix at the time of this writing, and it will change with subsequent releases.)

To add our Amazon Web application to the template, you need to add in the following elements (in bold) to the configuration file:


...
<templateDocumentType extension="asmx" 
    templateCategory="Web Services"
    name="Output Caching"
    createNewDescription="Output Cache Web Services."/>
<!-- ** End Web Service Templates ** -->

<!-- ** Start Consume Web Service Templates ** -->
<templateDocumentType extension="aspx" 
    templateCategory="Consume Web Services"
    name="Amazon Web service"
    createNewDescription=
      "Web app to consume Amazon's Web service."/>
<!-- ** End Consume Web Service Templates ** -->

<!-- ** Start Security Templates ** -->
<templateDocumentType extension="aspx" 
    templateCategory="Security"
    name="Login Page"
    createNewDescription=
      "Login page for Forms Based Authentication."/>
...

You also need to create the following subdirectories within the Templates directory.


Figure 14. Creating the directory to store the template

As shown in Figure 14, you need to create the directory Consume Web Services/Amazon Web Service/Csharp (and VB). Copy the Amazon.aspx file that we created earlier, paste it into the VB directory, and rename it as NewFile.aspx.

Next, restart ASP.NET Web Matrix to cause it to reload the configuration file. You should now be able to see the updated template:


Figure 15. Updated template

Summary

I quite liked ASP.NET Web Matrix, but the lack of Intellisense is really a big limitation. One day, I hope, someone will write an add-in to it. Besides the features discussed in this article, ASP.NET Web Matrix also includes links to online discussion forums and newgroups. What's more, you can also link to your contacts using your Windows Messenger's contact list. Overall, the ASP.NET Web Matrix provides a viable development environment for developing ASP.NET applications. The tight integration with the online community makes seeking help relatively easy.

Wei-Meng Lee (Microsoft MVP) http://weimenglee.blogspot.com is a technologist and founder of Developer Learning Solutions http://www.developerlearningsolutions.com, a technology company specializing in hands-on training on the latest Microsoft technologies.

Brian Jepson is an O'Reilly editor, programmer, and co-author of Mac OS X Panther for Unix Geeks and Learning Unix for Mac OS X Panther. He's also a volunteer system administrator and all-around geek for AS220, a non-profit arts center in Providence, Rhode Island. AS220 gives Rhode Island artists uncensored and unjuried forums for their work. These forums include galleries, performance space, and publications. Brian sees to it that technology, especially free software, supports that mission. You can follow Brian's blog here.