Welcome!

Steven Mandel

Subscribe to Steven Mandel: eMailAlertsEmail Alerts
Get Steven Mandel via: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Article

Build Your Own ASP.NET 2.0 Web Site Using C# & VB.NET

The ultimate ASP.NET beginner's guide

This book contains 14 chapters and an appendix. Its subtitle is "the ultimate ASP.NET beginner's guide." As its two titles imply, this book covers the basics on a lot of ASP.NET topics. The chapter titles convey this: ASP.Net basics, VB and C# programming basics, constructing ASP.NET Web pages, database design and development, etc.

The authors state that the book is designed for beginner, intermediate, and advanced users. I am not sure about how effective the book will be for the intermediate and advanced users because the book barely skims the surface regarding object-oriented design and design patterns. It is, however, really good for beginners trying to get a feel for what Web programming is all about. The book takes your hand and walks you through all the nuts and bolts of getting a Web site up and running installing .NET to configuring IIS (Internet Information Services).

Microsoft has made it very easy to begin to learn ASP.NET and database programming by providing free tools that you can download. This book makes use of several of these tools: SQL Server 2005 express edition, SQL Server Management Studio, and Visual Web Developer 2005. All the examples provided are in C# and VB.Net.
The book creates a fictional Web site called dorknozzle ( the authors' name not mine ) and proceeds throughout the book to use this Web site to build examples that demonstrate the concepts that they are trying to convey. I like this approach because at the end of the book you have a functioning Web site that you can use as an example for future projects.

In conjunction with their discussion of ADO.NET, they cover datalists, grid views, and detail views as well as the new SQL data source object. They also have a nice discussion on the literal text Web control that most books skip. I also liked the chapter on sending emails in ASP.NET 2.0. The authors give a nice explanation on how to set up your mail server to send the email. I am running Windows XP and I created a demo program based on the example in the book that sends a dummy email when you click on a button. I could not get my local mail server to send the email, but, using a suggestion from a colleague, I used my Yahoo mail server instead and it worked just fine. I am attaching my code below; please substitute your own information wherever appropriate in the code.

This book is a fine starting point for a beginner wanting to get his/her feet wet. It will give you a good foundation to build upon but eventually you are going to want to expand your skills in areas such as object-oriented design and design patterns.

ASP.NET email demonstration code:
---------------------------------------
Imports System.Net.Mail

Partial Class EmailDemo
   Inherits System.Web.UI.Page

Protected Sub btnSendEmail_Click(ByVal sender As Object, ByVal e As System.EventArgs) _
   Handles btnSendEmail.Click

     Dim mySmtp As New smtpclient

     Dim myMessage As New MailMessage

     Try

       Dim fromAddress As New MailAddress("your_login@yahoo.com", "from test email demo")

       Dim toAddress As New MailAddress("your_loginID@yahoo.com", "to test email demo")

       myMessage.From = fromAddress
       myMessage.To.Add(toAddress)
       myMessage.Subject = "Testinfo Email Demo "
       myMessage.Body = "this is a sample email"
       ' mySmtp.Host = "localhost" ' this did not work for me5t
       mySmtp.Host = "smtp.att.yahoo.com"
       mySmtp.Credentials = New System.Net.NetworkCredential("your_loginID", "your_password")

       mySmtp.Send(myMessage)

       Me.lblstatus.Text = "message sent"

     Catch ex As Exception

       Me.lblstatus.Text = "message NOT sent"

     End Try

   End Sub

End Class

By Cristian Darie, Zak Ruvalcaba
Format: Revised Edition
Publication Date: October 2006
ISN: 0975240285
List Price: $44.95
Development Tool: Visual Studio.NET & SQL Server Management Studio (Express or Higher Editions )
Level: Beginner
Language: T-SQL , VisualBasic.NET, C#

More Stories By Steven Mandel

Steven Mandel has worked in the IT industry for over 15 years designing databases using Microsoft Access and SQL Server. He has developed Web and Windows applications using VB.NET and has written numerous articles and reviews about ASP.NET and VB.NET.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.