You are previewing Beginning jQuery 2 for ASP.NET Developers: Using jQuery 2 with ASP.NET Web Forms and ASP.NET MVC.
O'Reilly logo
Beginning jQuery 2 for ASP.NET Developers: Using jQuery 2 with ASP.NET Web Forms and ASP.NET MVC

Book Description

jQuery is the most popular JavaScript library in use today, appearing on nearly two thirds of the 10,000 most visited sites on the web. With this sort of popularity, it's clear that ASP.NET developers can't afford to miss out.

By combining jQuery with ASP.NET you get the best of both worlds: the client-side interactivity and responsiveness of JavaScript with the robustness and extensibility of Microsoft's web stack. Beginning jQuery 2 for ASP.NET Developers shows you how.

To begin with, you'll find out how jQuery hooks up with your ASP.NET controls, and simplifies event handling by keeping it in the browser. Then you'll learn to handle dynamic content and responsive layouts by interacting with the DOM. Effects and animations are one of the most popular uses of the jQuery library, so we cover that next–showing you how to get a sleek modern look and feel to your site using some of the vast library of JavaScript that's already out there waiting to be used.

Ajax is one of the areas where jQuery really shines, so you'll find out how to make Ajax calls to a web service and get data onto a page without waiting for slow ASP.NET postbacks every time. And no book on jQuery would be complete without jQuery Mobile: the popular mobile web framework that gets you writing sites that work across all the major mobile platforms.

What you'll learn

  • Select DOM elements using powerful jQuery selectors

  • Use jQuery with ASP.NET server controls, ASP.NET MVC form fields and other DOM elements

  • Manipulate and traverse the DOM tree and add jQuery effects to ASP.NET web pages

  • Make Ajax calls and pass JSON data to Web Services, Web Methods, WCF services, controller action methods, HTTP handlers and Web APIs

  • Understand code reuse by creating and using jQuery plugins

  • Get introduced to jQuery UI and jQuery mobile and use them in ASP.NET Web Forms and MVC applications

Who this book is for

This book is for novice to intermediate developers who want to improve and enhance their ASP.NET Web Forms and ASP.NET MVC projects with client-side scripting.

Table of Contents

  1. Title Page
  2. Dedication
  3. Contents at a Glance
  4. Contents
  5. About the Author
  6. About the Technical Reviewer
  7. Acknowledgments
  8. Introduction
    1. Who This Book Is For
    2. Software Required
    3. How This Book Is Structured
    4. Downloading the Source Code
    5. Contacting the Author
  9. CHAPTER 1: The JavaScript You Need to Know
    1. Your First JavaScript Program
    2. Basic Programming Constructs
    3. Working with Strings
    4. Working with Numbers
    5. Working with Dates and Times
    6. Writing Functions
    7. Writing JavaScript Code in a Separate File
    8. Error Handling
    9. Summary
  10. CHAPTER 2: A First Look at jQuery
    1. What Is jQuery?
    2. What Can jQuery Do for You?
    3. jQuery 1.x and 2.x
    4. Adding jQuery to ASP.NET Projects
    5. Referencing jQuery from Web Forms and Views
    6. Visual Studio IDE and jQuery Code
    7. Writing Your First jQuery Program in ASP.NET Web Forms
    8. Writing Your First jQuery Program in ASP.NET MVC
    9. Summary
  11. CHAPTER 3: ASP.NET Controls and jQuery Selectors
    1. Overview of jQuery Selectors
    2. Basic Selectors
    3. Basic Filters
    4. Attribute Selectors
    5. Child Filters
    6. Content Filters
    7. Form Filters
    8. Hierarchy Filters
    9. Visibility Filters
    10. Using Selectors in ASP.NET MVC
    11. Summary
  12. CHAPTER 4: Event Handling
    1. Overview of Event Handling
    2. Working with Common Events
    3. Advanced Event Handling Concepts
    4. Summary
  13. CHAPTER 5: DOM Manipulation and Dynamic Content
    1. CSS Classes and Styles
    2. Working with Attributes and Properties
    3. Changing the Contents of DOM Elements
    4. Adding and Removing DOM Elements
    5. Copying DOM Elements
    6. Creating an RSS Reader Widget
    7. Summary
  14. CHAPTER 6: Traversal and Other Useful Methods
    1. Tree Traversal
    2. Filtering
    3. Iterating and Searching
    4. Accessing Custom Data Attributes
    5. Other Useful Methods
    6. Summary
  15. CHAPTER 7: Effects and Animations
    1. Showing and Hiding Elements
    2. Adding Sliding Effects
    3. Adding Fading Effects
    4. Performing Custom Animations
    5. Stopping the Animation
    6. Summary
  16. CHAPTER 8: Ajax Techniques
    1. Ajax Overview
    2. Benefits of Using Ajax
    3. Understanding the JSON Format
    4. jQuery Ajax Methods
    5. Using the $.ajax( ) Method
    6. Summary
  17. CHAPTER 9: Creating and Using Plugins
    1. Understanding jQuery Plugins
    2. Overview of JavaScript Function Prototypes
    3. Creating Your Own Plugin
    4. Developing a popupAd Plugin
    5. Summary
  18. CHAPTER 10: jQuery UI and jQuery Mobile
    1. Overview of jQuery UI
    2. Overview of jQuery Mobile
    3. Using jQuery Mobile
    4. Detecting Mobile Device in ASP.NET
    5. Summary
  19. CHAPTER 11: Useful jQuery Recipes for ASP.NET Applications
    1. Recipe 1: Converting GridView Data to CSV
    2. Recipe 2: Implementing Ajax Based Paging
    3. Recipe 3: Client-Side Sorting in a Table
    4. Recipe 4: Creating Cascading Drop-Down Lists
    5. Recipe 5: Creating an Autocomplete Text Box
    6. Recipe 6: Uploading Files
    7. Summary
  20. APPENDIX: Learning Resources
    1. Official jQuery Projects Websites
    2. Author’s Website
    3. Other Websites
  21. Index