professional asp.net 4.5 in c# and vb

1.4K 4K 0
professional asp.net 4.5 in c# and vb

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

www.it-ebooks.info ffirs.indd iffirs.indd i 4/10/2013 9:08:25 PM4/10/2013 9:08:25 PM www.it-ebooks.info PROFESSIONAL ASP.NET 4.5 IN C# AND VB INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xliii  PART I ASP.NET FUNDAMENTALS CHAPTER 1 One ASP.NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 CHAPTER 2 HTML5 and CSS3 Design with ASP.NET . . . . . . . . . . . . . . . . . . . . . . . . . . .17 CHAPTER 3 ASP.NET Web Forms Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 PART II CONTROLS CHAPTER 4 ASP.NET Server Controls and Client-Side Scripts . . . . . . . . . . . . . . . . . 103 CHAPTER 5 ASP.NET Web Server Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 CHAPTER 6 Validation Server Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 CHAPTER 7 User and Server Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231  PART III DATA ACCESS CHAPTER 8 Data Binding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299 CHAPTER 9 Model Binding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355 CHAPTER 10 Querying with LINQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .371 CHAPTER 11 Entity Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411 CHAPTER 12 ASP.NET Dynamic Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443 CHAPTER 13 Working with Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455 PART IV PROVIDERS CHAPTER 14 Introduction to the Provider Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .529 CHAPTER 15 Extending the Provider Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559  PART V ASP.NET FEATURES CHAPTER 16 Working with Master Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591 CHAPTER 17 Site Navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621 CHAPTER 18 Personalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671 CHAPTER 19 Membership and Role Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701 CHAPTER 20 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 759 Continues ffirs.indd iffirs.indd i 4/10/2013 9:08:25 PM4/10/2013 9:08:25 PM www.it-ebooks.info  PART VI APPLICATION STATE CHAPTER 21 State Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791 CHAPTER 22 Caching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823  PART VII CLIENT-SIDE DEVELOPMENT CHAPTER 23 ASP.NET AJAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 857 CHAPTER 24 Ajax Control Toolkit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 895 CHAPTER 25 jQuery. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 957 CHAPTER 26 Real-Time Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 983 CHAPTER 27 Developing Websites with Mobile in Mind . . . . . . . . . . . . . . . . . . . . . . 1001  PART VIII APPLICATION CONFIGURATION AND DEPLOYMENT CHAPTER 28 Confi guration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1027 CHAPTER 29 Debugging and Error Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1075 CHAPTER 30 Modules and Handlers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1105 CHAPTER 31 Asynchronous Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1121 CHAPTER 32 Building Global Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1135 CHAPTER 33 Packaging and Deploying ASP.NET Applications . . . . . . . . . . . . . . . . .1163  PART IX ADDITIONAL ASP.NET TECHNOLOGIES CHAPTER 34 ASP.NET MVC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1187 CHAPTER 35 ASP.NET Web Pages and Razor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1215  PART X APPENDIXES APPENDIX A Migrating Older ASP.NET Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1239 APPENDIX B COM Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1247 APPENDIX C ASP.NET Ultimate Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1257 APPENDIX D Administration and Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1269 APPENDIX E Dynamic Types and Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1295 APPENDIX F ASP.NET Online Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1305 APPENDIX G Visual Studio Extensibility with NuGet . . . . . . . . . . . . . . . . . . . . . . . . . . 1309 INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1333 ffirs.indd iiffirs.indd ii 4/10/2013 9:08:26 PM4/10/2013 9:08:26 PM www.it-ebooks.info PROFESSIONAL ASP.NET 4.5 in C# and VB ffirs.indd iiiffirs.indd iii 4/10/2013 9:08:26 PM4/10/2013 9:08:26 PM www.it-ebooks.info ffirs.indd ivffirs.indd iv 4/10/2013 9:08:26 PM4/10/2013 9:08:26 PM www.it-ebooks.info PROFESSIONAL ASP.NET 4.5 in C# and VB Jason N. Gaylord Christian Wenz Pranav Rastogi Todd Miranda Scott Hanselman ffirs.indd vffirs.indd v 4/10/2013 9:08:26 PM4/10/2013 9:08:26 PM www.it-ebooks.info Professional ASP.NET 4.5 in C# and VB Published by John Wiley & Sons, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.com Copyright © 2013 by John Wiley & Sons, Inc., Indianapolis, Indiana Published simultaneously in Canada ISBN: 978-1-118-31182-0 ISBN: 978-1-118-42438-4 (ebk) ISBN: 978-1-118-33205-4 (ebk) ISBN: 978-1-118-33534-5 (ebk) Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions. Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and speci cally disclaim all warranties, including without limitation warranties of  tness for a particular purpose. No warranty may be created or extended by sales or pro- motional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the pub- lisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Web site may provide or recommendations it may make. Further, readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was written and when it is read. For general information on our other products and services please contact our Customer Care Department within the United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002. Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with stan- dard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://book support.wiley.com. For more information about Wiley products, visit www.wiley.com. Library of Congress Control Number: 2013933610 Trademarks: Wiley, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its af liates, in the United States and other countries, and may not be used without written permission. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc., is not associated with any product or vendor mentioned in this book. ffirs.indd viffirs.indd vi 4/10/2013 9:08:26 PM4/10/2013 9:08:26 PM www.it-ebooks.info To my loving wife, Lisa, and our four awesome children. —J N. G I would like to dedicate this book with the following quote, to my mother who has been instrumental in my upbringing and is an integral part of my life. Abraham Lincoln said, “All that I am, or hope to be, I owe to my angel mother.” —P R To Kelly, Amber, and Sydney —T M To my wife and the two little boys I work for. —S H ffirs.indd viiffirs.indd vii 4/10/2013 9:08:27 PM4/10/2013 9:08:27 PM www.it-ebooks.info ffirs.indd viiiffirs.indd viii 4/10/2013 9:08:27 PM4/10/2013 9:08:27 PM www.it-ebooks.info [...]... 343 344 344 Inline Data-Binding Syntax Data-Binding Syntax XML Data Binding 347 348 348 Using Expressions and Expression Builders Summary CHAPTER 9: MODEL BINDING Model Binding 349 353 355 355 Selecting Data Paging Filtering Using Value Providers Inserting Data Updating Data 356 357 357 358 359 360 Using Strongly Typed Controls Extending Model Binding Custom Value Providers Custom Model Binders Custom... www.it-ebooks.info ftoc.indd xxii 4/10/2013 9:09:23 PM CONTENTS CHAPTER 10: QUERYING WITH LINQ LINQ to Objects 371 372 Understanding Traditional Query Methods Replacing Traditional Queries with LINQ Grouping Data Using LINQ Using Other LINQ Operators Making LINQ Joins Paging Using LINQ LINQ to XML 372 376 384 385 386 387 388 A Simple LINQ to XML Example Joining XML Data LINQ to SQL 389 392 393 Using the... Transform File Bundling and Minification What Is Bundling and Minification? Enabling Bundling and Minification Summary 1051 1053 1054 1059 1062 1063 1064 1064 1065 1066 1068 1068 1070 1072 1072 1073 1074 CHAPTER 29: DEBUGGING AND ERROR HANDLING Design-Time Support 1075 1075 Syntax Notifications Immediate and Command Window Task List Tracing 1076 1077 1077 1078 System.Diagnostics.Trace and ASP.NET s Page.Trace... 1002 Modifying the Viewport Using CSS Media Queries 1003 1005 ASP.NET Mobile Applications 1007 Detecting Mobile Browsers and Devices Serving Mobile Master Pages Creating Mobile Web Forms Friendly URLs in ASP.NET Web Forms ASP.NET MVC 4 Mobile Applications Adaptive Rendering in ASP.NET MVC 4 Creating Mobile-Specific Views Providing Display Modes Including jQuery Mobile and the ViewSwitcher Using the Mobile... Process Storing Application-Specific Settings Programming Configuration Files Protecting Configuration Settings Editing Configuration Files Creating Custom Sections Using the NameValueFileSectionHandler Object Using the DictionarySectionHandler Object Using the SingleTagSectionHandler Object Using Your Own Custom Configuration Handler Using Configuration Transforms Adding web.config Transforms Updating the Config... Passwords ASP.NET 4.5 Authorization Using the LoginView Server Control Setting Up Your Website for Role Management Adding and Retrieving Application Roles Deleting Roles Adding Users to Roles Getting All the Users of a Particular Role Getting All the Roles of a Particular User Removing Users from Roles Checking Users in Roles Understanding How Roles Are Cached Using the SimpleMembership API Using the... developer and Director of Technology at United One Resources in Wilkes-Barre, Pennsylvania His programming career started with a simple GOTO statement and continued over 15 years of developing Windows and web applications During this time, Jason has had the opportunity to plan, build, test, and deploy several enterprise applications including integrations with accounting and operating systems and B2B... Introducing One ASP.NET 3 Evolution of ASP.NET The Web Evolves and We Evolve with It Simplifying a Complex Ecosystem Web Ecosystem Getting Started Is Easy Integrating the Ecosystem Is Easy Real-World Example How Do You Benefit? 4 5 6 7 8 9 11 14 ASP.NET Makes Getting Started Easy ASP.NET Supports the Web Ecosystem ASP.NET Makes Finding, Adding, and Updating Lego Blocks to Your Site Easy ASP.NET Helps... (UserControl) Caching Post-Cache Substitution HttpCachePolicy and Client-Side Caching Caching Programmatically Data Caching Using the Cache Object Controlling the ASP.NET Cache Cache Dependencies NET 4.x’s New Object Caching Option Using the SQL Server Cache Dependency Enabling Databases for SQL Server Cache Invalidation Enabling Tables for SQL Server Cache Invalidation Looking at SQL Server Looking at the... ASPInsider Ken does consulting work from his home in Nipissing Township, Ontario, Canada BIPIN JOSHI is an independent blogger and author who writes about apparently unrelated topics — yoga and technology A former software consultant and trainer by profession, Bipin has been programming since 1995 and has worked with the NET Framework since its inception He is a published author and has authored or co-authored . System (IIS Express) 54 Using IIS 55 Using FTP 56 The ASP. NET Page Structure Options 57 Inline Coding 57 Code-Behind Model 59 ASP. NET 4. 5 Page Directives 61 @Page 62 @Master 64 @Control 66 @Import. vffirs.indd v 4/ 10/2013 9:08:26 PM4/10/2013 9:08:26 PM www.it-ebooks.info Professional ASP. NET 4. 5 in C# and VB Published by John Wiley & Sons, Inc. 1 047 5 Crosspoint Boulevard Indianapolis, IN 46 256 www.wiley.com Copyright. www.it-ebooks.info ffirs.indd iffirs.indd i 4/ 10/2013 9:08: 25 PM4/10/2013 9:08: 25 PM www.it-ebooks.info PROFESSIONAL ASP. NET 4. 5 IN C# AND VB INTRODUCTION . . . . . . . . . .

Ngày đăng: 01/08/2014, 16:34

Từ khóa liên quan

Mục lục

  • Professional: ASP.NET 4.5 in C# and VB

  • Copyright

  • About the Authors

  • About the Technical Editors

  • Credits

  • Acknowledgments

  • Contents

  • Foreword

  • Introduction

    • The Past, Present, and Future of ASP.NET

    • What You Need for ASP.NET 4.5

    • Who This Book is For

    • What This Book Covers

    • Conventions

    • Source Code

    • Errata

    • P2P.Wrox.Com

    • Part I: ASP.NET Fundamentals

      • Chapter 1: One ASP.NET

        • Introducing One ASP.NET

          • Evolution of ASP.NET

          • The Web Evolves and We Evolve with It

          • Simplifying a Complex Ecosystem

            • Web Ecosystem

            • Getting Started Is Easy

Tài liệu cùng người dùng

Tài liệu liên quan