ASP.Net - keeping it simple
Published: 31 Jul 2002 12:40 BST

Microsoft surprised the IT community by making ASP.Net and the C# compiler/specification freely available. Now, a free Web design tool called ASP.Net Web Matrix is available as well. The tool is a watered-down version of Visual Studio .Net that supports basic ASP.Net coding for simpler Web applications. Let's take a look at this recently released software and see just what it can do.
Where can I get it?
You can download ASP.Net Web Matrix from the ASP.Net Web site, which has a short registration process. The software is closely integrated with the ASP.Net site, and good support is available. The senior ASP.Net specialists hang out in the online forums. They can assist with installation and running Web Matrix, as well as with ASP.Net.
What can it do?
Primarily, Web Matrix is good at writing ASP.Net Web pages. Figure A shows the Web Matrix environment. Open up Web Matrix after installation, and it will suggest that you create a new file (see Figure B). Next, you can build a Web form. You have the option of viewing the page in design view, HTML, code, or HTML and code together.
| Figure A |
![]() |
| ASP.Net Web Matrix environment |
| Figure B |
![]() |
| Create a new Web Matrix file. |
Web Matrix doesn't use the codebehind model you might be accustomed to from Visual Studio. Instead, all script is inline, as ASP Classic was. In design view, you can move a TextBox into the viewer and double-click on it. The viewer changes to code view, and you have the option to edit the TextChanged event handler of the box. Change to the All view, and you'll see that the event handler is within a SCRIPT RUNAT="server" block. Because of this, the code isn't compiled into a DLL, so there is no need for a build process. Also, Web Matrix has its own Web server -- the Web Matrix Server -- running on port 8080.
Use databinding with server controls
Databinding is made easy with Web Matrix. Need a dataset? No problem. Change to code view and drag the SELECT Data Method to the screen. A nice wizard walks you though selection of a database and some fields (for this example, a list of customers), and then it generates a function to call to get the dataset, as shown in Listing A.
This dataset can be databound to a datagrid just as normal. Back in design view, you can drag a datagrid on the screen, and three lines of custom code will bind the grid to the new dataset:Dim dataSet As System.Data.DataSet = MyQueryMethod()DataSet1.DataSource = dataSetDataSet1.DataBind()
Manage SQL Server databases
The Data tab is in the same panel as the workspace. Click the Connection icon (the one that looks like a tin can with a tail). After walking through a similar connection wizard as above, you'll get the view and edit tables and stored procedures that are related to this database. This is just another hint that Microsoft wants developers to get away from developing with Access and start using SQL Server.
Create Mobile Web applications, and more
If you click the New File button in the upper-left corner, you'll see that there are quite a number of file types, all of which will give you a good start developing specific kinds of solutions:
- Web forms
- Web user controls
- HTML pages
- XML Web services
- Class files
- Style sheets
- Configuration files
- XML FILES, including schemas
- Custom HTTP handlers
- SQL files
- Plain text
- Data pages -- Templates for often used Web forms
- Mobile pages -- Including forms and user controls
- Output caching
- Security -- Log in and out
- Web services -- Advanced concepts in Web services











