Asp.Net in Action

Only available on StudyMode
  • Topic: Ajax, JavaScript, ASP.NET
  • Pages : 544 (141102 words )
  • Download(s) : 782
  • Published : April 6, 2011
Open Document
Text Preview
ASP.NET AJAX in Action

ASP.NET AJAX in Action
ALESSANDRO GALLO DAVID BARKOL RAMA KRISHNA VAVILALA

MANNING
Greenwich (74° w. long.)

For online information and ordering of this and other Manning books, please visit www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact: Special Sales Department Manning Publications Co. Sound View Court 3B fax: (609) 877-8256 Greenwich, CT 06830 email: orders@manning.com

©2008 by Manning Publications Co. All rights reserved.

No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher.

Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps.

Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end.

Manning Publications Co. Sound View Court 3B Greenwich, CT 06830

Copyeditor: Tiffany Taylor Typesetter: Gordan Salinovic Cover designer: Leslie Haimes

ISBN 1-933988-14-2 Printed in the United States of America 1 2 3 4 5 6 7 8 9 10 – MAL – 13 12 11 10 09 08 07

To those who wait —A.G. To my wife and best friend, Emily —D.B. To my parents, for making me who I am! —R.K.V.

brief contents
PART 1 ASP.NET AJAX BASICS ................................................1 1 2 3 4 5 6
■ ■ ■ ■ ■ ■

Introducing ASP.NET AJAX JavaScript for Ajax developers

3 36 73 114 141 194

First steps with the Microsoft Ajax Library Exploring the Ajax server extensions Making asynchronous network calls

Partial-page rendering with UpdatePanels

PART 2

ADVANCED TECHNIQUES ...........................................229 7 8 9 10
■ ■ ■ ■

Under the hood of the UpdatePanel ASP.NET AJAX client components Building Ajax-enabled controls 299

231 264

Developing with the Ajax Control Toolkit 332

vii

viii

BRIEF CONTENTS

PART 3

ASP.NET AJAX FUTURES .........................................371 11 12
■ ■

XML Script

373 410

Dragging and dropping

PART 4

MASTERING ASP.NET AJAX .....................................441 13


Implementing common Ajax patterns

443

contents
forewords xvii preface xxi acknowledgments xxiii about this book xxv about the authors xxxi about the title xxxii about the cover illustration

xxxiii

PART 1 ASP.NET AJAX BASICS ..................................... 1

1

Introducing ASP.NET AJAX
1.1 What is Ajax? 4

3

Ajax components 5 ■ Asynchronous web programming 7 The XMLHttpRequest object 10 ■ Ajax development issues

14

1.2

ASP.NET AJAX architecture

15

Client framework 16 ■ Server framework 19 ■ Client-centric development model 20 ■ Server-centric development model 21 ASP.NET AJAX goals 22

1.3

ASP.NET AJAX in action

23


Simple server-centric solution 23 Simple client-centric example 30

UpdateProgress control 28

1.4

Summary

34
ix

x

CONTENTS

2

First steps with the Microsoft Ajax Library 36
2.1 A quick overview of the library


37

Library features 37 Ajax-enabling an ASP.NET page 39 ■ Script versions 40

2.2

The Application model
Client components 43 Microsoft Ajax!” 45


42
Client-page lifecycle 44


“Hello

2.3

Working with the DOM

48

The abstraction API 48 ■ A dynamic, cross-browser text box 49 CSS and positioning 53 ■ Client delegates 54 $addHandlers and $clearHandlers 56 ■ Callbacks 57

2.4

Making development with JavaScript easier

58

The String object 58 ■ Sys.StringBuilder 59 ■ The Array object 61 ■ Globalization 63 ■ Browser...
tracking img