Book Image

ASP.NET jQuery Cookbook

By : Sonal Aneel Allana
Book Image

ASP.NET jQuery Cookbook

By: Sonal Aneel Allana

Overview of this book

<p>jQuery is a powerful, lightweight JavaScript library that simplifies various web development tasks. With the integration of jQuery with Visual Studio 2010, it has become increasingly popular for ASP.NET developers to use jQuery's awesome power in their applications. Combining jQuery and ASP.NET creates applications that are anything but lightweight. Using this Cookbook you will become adept at using this library in your ASP.NET web applications.</p> <p>This cookbook shares the most powerful, impressive, and just plain handy jQuery secrets for ASP.NET developers. From substitute server-side code to corresponding client script, it shows ASP.NET developers how to get the most from jQuery in a simple, effective, and easy manner.</p> <p>The cookbook takes a pragmatic approach in applying the jQuery library to ASP.NET applications. It will help you to master the use of jQuery with ASP.NET by taking you step-by-step through hands-on, practical recipes. With its help, you can learn to manipulate various ASP.NET controls like TextBox, CheckBoxList, DropDownList, BulletedList, Hyperlink, Image, and GridView as well as custom user controls. The book teaches client validation techniques thus providing a substitute for the server-side Validation Control. It explores various graphic and animation effects that can be accomplished very easily with the library to give a better interactive experience to the end user. It explores AJAX in depth and describes the use of Firebug to view / troubleshoot the corresponding request / response dialog. You will also learn to develop rich content using client scripting.</p>
Table of Contents (15 chapters)
ASP.NET jQuery Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Sliding elements on a page


In this recipe, we will use the slideUp and slideDown methods for achieving sliding effects on an ASP.NET panel.

Getting ready

  1. Add a new web form Recipe3.aspx in the current project.

  2. Add an ASP.NET panel to the page as follows:

    <asp:Panel class="slide" runat="server">
                Sliding Panel
    </asp:Panel>
  3. The css class for the panel is defined as follows:

    .slide
        {
      font-size:12px;
      font-family:Arial,sans-serif;
      display:none;
      height:100px;
      background-color:#9999FF;
        }
  4. Add a button control to trigger the sliding effect on the panel:

    <asp:Button ID="btnSubmit" runat="server" Text="Trigger Slide" />
  5. Thus, the complete ASPX markup of the web form is as follows:

    <form id="form1" runat="server">
    <div align="center">
    <fieldset style="width:400px;height:150px;">
    <asp:Button ID="btnSubmit" runat="server" Text="Trigger Slide" />
    <br /><br/>
    <asp:Panel class="slide" runat="server">
                Sliding Panel...