You are previewing ASP.NET jQuery Cookbook - Second Edition.
O'Reilly logo
ASP.NET jQuery Cookbook - Second Edition

Book Description

Over 60 recipes for writing client script in ASP.NET 4.6 applications using jQuery

About This Book

  • This is a step-by-step guide to solve common problems in ASP.NET applications

  • Easy-to-follow recipes to write client scripts effortlessly and quickly

  • A hands-on approach that will show you how to interface jQuery with ASP.NET websites and MVC

  • Who This Book Is For

    This book is for ASP.NET developers who want to use jQuery to write client scripts for cross-browser compatibility. The book assumes no prior knowledge of ASP.NET or jQuery, and every recipe is self-contained and explained in an easy-to-follow manner. Familiarity with Visual Studio and MS SQL Server is preferred, but not compulsory.

    What You Will Learn

  • Download and include jQuery in ASP.NET websites and MVC

  • Use jQuery selectors with ASP.NET server controls

  • Get to know about event handling and DOM traversal

  • Deploy jQuery for visual effects and animations

  • Develop AJAX-enabled ASP.NET applications

  • Create your own plugins

  • Solve common problems using less code and cut down your development time

  • In Detail

    jQuery is a lightweight JavaScript library that has changed the landscape of client scripting in web applications. Developed by John Resig in 2006, it has taken the web by storm because of its cross-browser compatibility and the ability to get more done with less code. It has gained popularity with ASP.NET developers and is now distributed with Visual Studio and the NuGet package manager.

    ASP.NET jQuery Cookbook explores the wide range of utilities that the jQuery library provides. It teaches you the nitty-gritty of plugging in these features in ASP.NET web applications. It covers every aspect of interfacing the library, right from downloading and including jQuery on web pages to selecting controls, handling events, and creating animations. This book also walks you through DOM traversal and manipulation in ASP.NET and then through visual effects and graphics in ASP.NET sites. It explores advanced features such as posting AJAX requests and writing plugins. It will provide you with all the information you need to use this library confidently with ASP.NET.

    Style and approach

    This book takes a hands-on, pragmatic approach to solving common problems in ASP.NET applications using jQuery. Every recipe has detailed steps with screen captures and code snippets. The necessary theoretical concepts are introduced as and when needed.

    Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

    Table of Contents

    1. ASP.NET jQuery Cookbook Second Edition
      1. Table of Contents
      2. ASP.NET jQuery Cookbook Second Edition
      3. Credits
      4. About the Author
      5. About the Reviewer
      6. www.PacktPub.com
        1. eBooks, discount offers, and more
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Sections
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Conventions
        6. Reader feedback
        7. Customer support
          1. Downloading the example code
          2. Downloading the color images of this book
          3. Errata
          4. Piracy
          5. Questions
      8. 1. Getting Started with jQuery in ASP.NET
        1. Introduction
        2. Downloading jQuery from jQuery.com
          1. Getting ready
          2. How to do it…
          3. See also…
        3. Understanding CDN for jQuery
          1. How to do it…
            1. Using CDNs for new releases
          2. How it works…
          3. See also
        4. Using NuGet Package Manager to download jQuery
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        5. Adding jQuery to an empty ASP.NET web project using a script block
          1. Getting ready
          2. How to do it…
          3. See also
        6. Adding jQuery to an empty ASP.NET web project using ScriptManager control
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        7. Adding jQuery to an ASP.NET Master Page
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        8. Adding jQuery programmatically to a web form
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        9. Understanding jQuery reference in the default web application template
          1. How to do it...
          2. How it works…
          3. See also
        10. Hello World in a web project using jQuery
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        11. Bundling jQuery in ASP.NET MVC
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        12. Using CDN to load jQuery in MVC
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        13. Hello World in ASP.NET MVC using jQuery
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        14. Debugging jQuery code in Visual Studio
          1. Getting ready
          2. How to do it…
          3. See also
      9. 2. Using jQuery Selectors with ASP.NET Controls
        1. Introduction
        2. Selecting a control using ID and displaying its value
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        3. Selecting a control using the CSS class
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        4. Selecting a control using HTML tag
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        5. Selecting a control by its attribute
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        6. Selecting an element by its position in the DOM
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        7. Enabling/disabling controls on a web form
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        8. Using selectors in MVC applications
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
      10. 3. Event Handling Using jQuery
        1. Introduction
          1. jQuery event binders
        2. Responding to mouse events
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        3. Responding to keyboard events
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        4. Responding to form events
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        5. Using event delegation to attach events to future controls
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        6. Running an event only once
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        7. Triggering an event programmatically
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        8. Passing data with events and using event namespacing
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        9. Detaching events
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
      11. 4. DOM Traversal and Manipulation in ASP.NET
        1. Introduction
        2. Adding/removing DOM elements
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        3. Accessing parent and child controls
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        4. Accessing sibling controls
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Refining selection using a filter
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        6. Adding items to controls at runtime
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
      12. 5. Visual Effects in ASP.NET Sites
        1. Introduction
        2. Animating the Menu control
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        3. Animating a Label control to create a digital clock
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        4. Animating the alt text of the AdRotator control
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Animating images in the TreeView control
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        6. Creating scrolling text in a Panel control
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        7. Creating a vertical accordion menu using Panel controls
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        8. Showing/hiding the GridView control with the explode effect
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
      13. 6. Working with Graphics in ASP.NET Sites
        1. Introduction
        2. Creating a spotlight effect on images
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        3. Zooming images on mouseover
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        4. Creating an image scroller
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        5. Building a photo gallery using z-index property
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        6. Building a photo gallery using ImageMap control
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        7. Using images to create effects in the Menu control
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        8. Creating a 5 star rating control
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        9. Previewing image uploads in MVC
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
      14. 7. Ajax Using jQuery
        1. Introduction
        2. Setting up Ajax with ASP.NET using jQuery
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        3. Consuming page methods
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        4. Consuming Web services
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        5. Consuming WCF services
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        6. Retrieving data from a Web API
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        7. Making Ajax calls to a controller action
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        8. Making Ajax calls to a HTTP handler
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
      15. 8. Creating and Using jQuery Plugins
        1. Introduction
        2. Creating and using a simple plugin
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        3. Using the $ alias in the plugin
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more
          5. See also
        4. Calling methods on DOM elements
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Providing default values
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        6. Providing method chaining
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        7. Adding actions to plugins
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        8. Using the form validation plugin
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        9. Downloading plugins using the NPM
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
      16. Index