ASRNET is the atest incarnation of Microsoft's Active Server Pages (ASP/- a powerful server-based technology, designed to create dvnamic and interactive HTML pages for vour web site or corporate intranet. ASRNET also constitutes a core element in Microsoft's .NET.vision. providing web-based access to an immensely powerful new development environment..NET: in this respect alone, it's a great leap ahead of all previous versions of ASR
This book will provide you with a step-by-step introduction to ASRNET using VB.NET, with plenty of worked examples that will help vou to gain a deep understanding of what ASRNET is all about, and how vou can harness it to build powerful web applications.
Who is this book for?
This book is aimed at relatively inexperienced web builders who a re looking to enrich their sites with dynamically-generated content, and want to learn how to start building web applications using ASR.NET Developers who have a little experience with previous versions of ASP .and are looking to move over' to ASRNET), may also find this book helpful in getting a simple grasp on what ASRNET is, what it does, and how it can be used. Experience of basic HTML is required, but Previous experience of ASP or VBScript is not essential. We'll be teaching the basics of VB.NET in this book, so prior experience of VB.NET is not required.
What does this book cover?
Creating basic ASRNET pages
Learning the basics of VB.NET
UnderStanding the concepts of Object Oriented Programming
Working with Data and XML
The ASRNET Server Controls
Creating User Controls and Components
Exploring the world of Web Services
Configuring your ASRNET Applications
ASP.NET is the latest incarnation of Microsoft's Active Server Pages (ASP) - a powerful server-based technology from Microsoft, designed to create dynamic and interactive HTML pages for your World Wide Web site, or corporate intranet. ASP.NET also constitutes a core element in Microsoft's .NET vision, providing web-based access to an immensely powerful new development environment, .NET; in this respect alone, it's a great leap ahead of all previous versions of ASP.
This purpose of this book is to teach you how to use ASP.NET to write web pages, whose content can be programmatically-generated from scratch every time the page is viewed. This not only saves you a lot of effort in presenting and updating your web pages, but also offers tremendous scope for adding sophisticated functionality to your site. This book will answer the fundamental questions:
What is ASP.NET?
How do I get install ASP.NET and get it up and running?
How does it work?
How can I use it to produce dynamic, interactive web applications?
We'll answer these questions in a thorough and comprehensive way, with plenty of fully working examples. Even if you're totally new to this technology, you will gain a deep understanding of what ASP.NET is ali abouT anD iearn how you Can harness it to build powerful web applications.
Who Is This Book For?
This book is aimed at relatively inexperienced web builders who are looking to enrich their sites with dynamically-generated content, and want to learn how to start building web applications using ASP.NET. Developers who have a little experience with previous versions of ASP (and are looking to move over to ASP.NET), may also find this book helpful in getting a simple grasp on what ASP.NET is, what it does, and how we can use it.
This is a Wrox Beginning... series book, so we will aim to teach you everything you need to know from scratch. If you already have some experience of programming ASP.NET or VB.NET, you may be more comfortable starting at a somewhat quicker pace with the natural follow-up title Professional ASP. NET (Wrox Press, ISBN 186004-88-5).
We appreciate that most_(if not all) of the web authors and developers who take up ASP.NET, are reasonably familiar with simple- HTML, so we won't spend lots of time on it teaching you to suck eggs. If you don't already know HTML, we suggest you take some time to get familiar with it before trying to learn about ASP.NET. There are plenty of good HTML tutorials available, both in books and on the Web.
There are two kinds of beginners for whom this is the ideal book:
You're a beginner to programming and you've chosen ASP.NET as the technology with which to get started. Great choice! ASP.NET is not only easy and fun, but it's also very useful, and very, very powerful. This book will hold your hand throughout.
You can program in another language, but you're a beginner to web programming. Again, this is a great choice! You may still have a few lessons to learn about programming in .NET, but this book will introduce you to how it does things in terms you'll understand.
Most importantly, you don't need to know anything more than the basic ins and outs of how to put your own web page together. If you've never written a single line of any programming language, then you have to nothing to fear - this is the book for you. The bottom line is as follows:
This book will teach you how to write ASP. NET applications.
What Does This Book Cover?
This book was written as Microsoft released the Beta 2 version of ASP.NET. This release is almost feature complete, and stable enough for developers to begin learning about and using the new technology as well as deploying live sites. Microsoft already has several live sites running on the beta release, which have proved faster than their older counterparts. While we can't guarantee that the final release version will be identical, you can be sure that almost all of the concepts, examples, and explanations we provide are accurate within the timeframe of the first full version of .NET.
In this book, we attempt to explain just what ASP.NET is all about, how you can use it, and what you can use it for. The book can be broken down into four main sections:
An Introduction to ASP. NET
In Chapters 1 to 3, we shall introduce some of the core concepts behind the Web and look at how ASP.NET adds to the range of web programming technologies already available. We'll take you through the process of installing the Microsoft .NET Framework (on which ASP.NET relies), and demonstrate some simple applications. We'll start to consider how ASP.NET works behind the scenes, and introduce some simple techniques for generating web pages with ASP.NET.
Programming ASP. NET
Chapters 4 through 7 go on to look at various ways in which we can store and m~t nipulate data in our programs, look at controlling the order in which commands are executed, and consider some simple issues of code structure.
Objects in ASP. NET
Objects and the principles of object-oriented programming (OOP) play a fundamental role in .NET, so Chapters 8 through 11 will familiarize you with the notion of OOP, the philosophy behind it, and the ways in which we can use objects to write more effective code
Practical ASP. NET
The final section of the book will discuss and demonstrate various techniques for making your web applications useful in the real world. Chapters 12 through 19 will consider topics such as error handling, data access, configuration, and building code components and web services.
What Do I Need to Run ASP. NET?
In order to answer this, we need to consider the role that we'll be playing in this book - namely that of the web developer or Webmaster. In this role, we'll be writing web pages, publishing them on a web server, and testing them to see what they look like and whether they work. This is just a list of items that you will need. Don't worry if you can't locate all the bits and pieces just yet, as we'll be looking at where to get them from in the opening chapter:
A text editor (such as Windows Notepad).
A web browser (any one should do, since the hard work is all done on the server).
An ASP.NET-compliant web server (ASP.NET requires lis 5.0 or later - this means that you'll need to be running Windows 2000 or Windows XP).
The .NET Framework (currently available in several different varieties - unless you have access to the full ".NET Framework SDK", w hieh features doc'umentation, tutorials, and a download size of over 100Mb, we suggest you download the slightly more modest but no less functional 18Mb "ASP.NET Premium Edition" from www.aspnet.com).
The code in this bOOk will n~t work with the -1 release of ASP.NET,
In order to make full use of .NET's data access functionality (which we look at in later chapters), you must make sure that you have version 2.7 or later of the Microsoft Data Access Components (MDAC2.7) installed on the same machine as your web server. We'll also assume you have a copy of Microsoft Access from which to access the sample data. Other databases such as MSDE and SQL Server are also fine, but most of the examples we show will require a little tweaking in order to work with these alternative databases.
Specifically for the purposes of this book, we discourage you flora using a web page editor such as FrontPage, or a fufu_U_U development tool like Visual Studio. While these are powerful tools that can be very helpful in a dev~[ot~'m[n~~nvironment, they will often add their own code to your web pages automatically. This can often make it harder to see what's going on, and can, at this level, really get in the way of what we're supposed to be demonstrating in a particular example...
When we browse pages on the Web, or even on a local intranet, the browser and the web server software are generally hosted on two di~rent physical machines. Note however, that it's quit~possible to run your text editor, browser, and web server simultaneously on the same machine. Indeed, web developers often use this technique as they write, test, rewrite and tweak their ASP.NET pages.
Conventions
We've used a number of different styles of text and layout in this book to help differentiate between the different kinds of information. Here are examples of the styles we used and an explanation of what they mean.
Code has several fonts. If it's a word that we're talking about in the text - for example, when discussing a For ... Next loop, it's in this font. If it's a block of code that can be typed as a program and run, then it's also in a gray box:
Sometimes we'll see code in a mixture of styles, like this:
Widget < / name>
/price>
In cases like this, the code with a white background is code we are already familiar with; the line highlighted in gray is a new addition to the code since we last looked at it.
Advice, hints, and background information comes in this type of font.
Important pieces of information come in boxes like this:
Bullets appear indented, with each new bullet marked as follows:
Important Words are in a bold type font.
Words that appear on the screen, or in menus like the File or Window, are in a similar font to the one you would see on a Windows desktop.
Keys that you press on the keyboard like Ctrl and Enter, are in italics.
Customer Support
We've tried to make this book as accurate and enjoyable as possible, but what really matters is what the book actually does for you. Please let us know your views, either by returning the reply card in the back of the book, or by contacting us via email at feedback@wrox.com.
Source Code and Updates
As we work through the examples in this book, you may decide that you prefer to type in all the codeby hand. Many readers prefer this, because it's a good way to get familiar with the coding techniques that are being used.
Whether you want to type the code in or not, we have made all the source code for this book available at our web site at the following address:
http://www.wrox.com/
If you like to type in the code, you can use our files to check the results you should be getting - they should be your first stop if you think you might have typed in an error. If you don't like typing, then downloading the source code from our web site is a must!
Either way, it'll help you with updates and debugging.
Errata
We've made every effort to make sure that there are no errors in the text or the code. However, to err is human, and as such, we recognize the need to keep you informed of any mistakes as they're spotted and corrected. Errata sheets are available for all our books at http://www.wrox.com. If you find an error that hasn't already been reported, please let us know. For more information on this, see Appendix G at the end of the book.
Our web site acts as a focus for other information and support, including the code from all Wrox books, sample chapters, previews of forthcoming titles, and articles and opinions on related topics.