.NET
  Home arrow .NET arrow Page 4 - Introducing the ASP.NET Web Matrix
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
.NET

Introducing the ASP.NET Web Matrix
By: Dan Wellman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 10
    2005-08-15

    Table of Contents:
  • Introducing the ASP.NET Web Matrix
  • Application Workspace
  • Testing Your Pages, Database Server
  • Browsers, Templates, and Wizards
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Introducing the ASP.NET Web Matrix - Browsers, Templates, and Wizards


    (Page 4 of 5 )

    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.

    More .NET Articles
    More By Dan Wellman


       · Hello everybody, this article aims to provide an overveiw of the exciting new...
     

    .NET ARTICLES

    - Using CrystalReportViewer to Display Crystal...
    - Creating Summary .Net Crystal Reports
    - More on Commands, Input and the WPF
    - Grouping and Aggregating When Querying LINQ ...
    - Commands, Input and the WPF
    - Keyboard and Ink Input with WPF
    - Mouse Input and the WPF
    - Input with Windows Presentation Foundation
    - Introducing LINQ with XML and Databases
    - An Introduction to LINQ
    - Querying LINQ to SQL: Basics
    - Completing a Simple Storefront with LINQ
    - Knowing Your Environment: the System.Environ...
    - Creating the Home Page for a Simple Storefro...
    - LINQ Quickly with Language Integrated Queries





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
    Stay green...Green IT