Validation of Aspnet Controls

Validation of a sample user login form Validation of basic field types in a user profile form Character limit validation in Multiline ASP.NET TextBox Validation of date range in ASP.NET form Validation of ASP.NET CheckBoxList Validation of ASP.NET RadioButtonList Validation of ASP.NET ListBox Control Validation of ASP.NET DropDownList Control In applications requiring user interaction, it is important to ensure that the data entered by the end user meets the specifications of the system....

Getting ready

Create a new web form Recipe1.aspx in the project. 2. Add an Image control to the page and link it to an image from the images folder lt asp Image ID Image1 Width 400 Height 2 50 runat server gt 3. Add a Button control for adding a hyperlink to the Image control dynamically. Add another Button control for removing the hyperlink. Disable this button initially lt asp Button ID btnAdd runat server Text Add Link gt amp nbsp lt asp Button ID btnRemove runat server Text Remove Link Enabled false...

How to do it

In the document.ready function of the jQuery script block, define the Employee array containing the sample data EmpID I53434, Name Richard Tan, Email richard someemail. com, Contact 65 24242444 , EmpID I53435, Name Thomas Lee, Email thomas someemail. com, Contact 65 8664664 , EmpID I53436, Name Joseph Yeo, Email joseph someemail. com, Contact 65 94643646 , EmpID I53437, Name Jasmine D'Souza, Email jasmine someemail.com, Contact 65 4225252 2. Apply the array data to the template and append to...

Birmingham Mumbai

No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the...

Info

In the document.ready function in the jQuery script block, use 'input text first' selector to retrieve a handle to the first ASP.NET TextBox. Call the focus event on this TextBox The ASP.NET engine renders a TextBox control as lt input type text gt I HTML element at runtime. Hence, the selector 'input text' I can be used to retrieve TextBox controls. The selector I 'input text first' retrieves the first TextBox on the form. I 2. Use bind to attach an event handler for keydown event on all...

Hid

lt title gt RECIPE TITLE lt title gt lt script src js jquery-1.4.1.js lt script lt form gt lt body gt lt html gt From the above sample ASPX form, note the following The jQuery library is included in the page header using lt script gt tags as follows lt script src js jquery-1.4.1.js The actual jQuery magic is applied in another script block in the page header lt script INCLUDE JQUERY MARKUP HERE lt script gt The web form with the required ASPX markup is included in the page body as follows lt...

Dragging and dropping Grid View rows

JQuery comes with a number of handy plugins to enhance the functionality of web controls. In user interactive applications, where there is a need to shuffle the rows of a GridView, we will see how we can apply a jQuery plugin to accomplish the task on the client without the need of a server-side refresh. 1. Add a new form Recipe4.aspx to the current project. 2. Download the jQuery Drag and Drop plugin available from http www.isocra. 3. Save the plugin file to the script folder js in the project...