PANTONE 2955 CPANTONE Orange 021 C
CMYK 100, 45, 0, 37CMYK O, 53, 100, 0
Black 100%Black 50%
CMYK:
Pantone:
Grey scale
THE ULTIMATE ASP.NET BEGINNER’S GUIDE
4TH EDITION
BUILD YOUR OWN
ASP.NET 4
WEBSITE
BY CRISTIAN DARIE
WYATT BARNETT
& TIM POSEY
USING C# & VB
Summary of Contents
Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
1. Introducing ASP.NET and the .NET Platform . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2. ASP.NET Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3. VB and C# Programming Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
4. Constructing ASP.NET Web Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
5. Building Web Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
6. Using the Validation Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
7. Database Design and Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
8. Speaking SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
9. ADO.NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
10. Displaying Content Using Data Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
11. Managing Content Using GridView and DetailsView . . . . . . . . . . . . 463
12. Advanced Data Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
13. Security and User Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569
14. Working with Files and Email . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615
15. Introduction to LINQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655
16. Introduction to MVC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
17. ASP.NET AJAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701
A. Web Control Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
B. Deploying ASP.NET Websites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 775
Do wn lo ad f ro m Wo w! e Bo ok < ww w. wo we bo ok .c om >
BUILD YOUR OWN
ASP.NET 4 WEBSITE
USING C# & VB
BY CRISTIAN DARIE
WYATT BARNETT
TIM POSEY
4TH EDITION
Build Your Own ASP.NET 4 Website Using C# & VB
by Cristian Darie, Wyatt Barnett, and Tim Posey
Copyright © 2011 SitePoint Pty. Ltd.
Editor: Sarah BroomhallExpert Reviewer: Pranav Rastogi
Index Editor: Michelle CombsProduct Editor: Simon Mackie
Cover Design: Alex WalkerTechnical Editor: Ricky Onsman
Latest Update: Fourth Edition: September
2011
Printing History:
First Edition: April 2004
Second Edition: October 2006
Third Edition: September 2008
Notice of Rights
All rights reserved. No part of this book may be reproduced, stored in a retrieval system or transmitted
in any form or by any means, without the prior written permission of the publisher, except in the case
of brief quotations embodied in critical articles or reviews.
Notice of Liability
The author and publisher have made every effort to ensure the accuracy of the information herein.
However, the information contained in this book is sold without warranty, either express or implied.
Neither the authors and SitePoint Pty. Ltd., nor its dealers or distributors, will be held liable for any
damages to be caused either directly or indirectly by the instructions contained in this book, or by the
software or hardware products described herein.
Trademark Notice
Rather than indicating every occurrence of a trademarked name as such, this book uses the names only
in an editorial fashion and to the benefit of the trademark owner with no intention of infringement of
the trademark.
Published by SitePoint Pty. Ltd.
48 Cambridge Street Collingwood
VIC Australia 3066.
Web: www.sitepoint.com
Email: business@sitepoint.com
ISBN 978-0-9870908-6-7 (print)
ISBN 978-0-9871530-3-6 (ebook)
Printed and bound in the United States of America
iv