Posts

Showing posts from 2010

Creating a sliding effect with JavaScript

This vertical sliding effect was created using JavaScript.   To use this control on your own page you will need to download the following file: VerticalSlide.js You will need include the JavaScript file in the header of your web page. <script type="text/javascript" src="scripts/VerticalSlide.js"></script> After creating the DIV you want to add the sliding effect to, create a JavaScript function for your button to call which will activate the sliding effect.  <script type="text/javascript">  function makeSlide(objName)  {  new VerticalSlide(objName);  }  </script>  For more information on how the sliding functionality works please read the comments in the VerticalSlide.js file.  If you are looking to add a horizontal sliding effect you may download the following JavaScript file: HorizontalSlide.js After including the HorizontalSlide.js file in your web page you will need to make a JavaScript function to acti...

Simple Image SlideShow using jQuery

 have seen a lot of users requesting for simple jQuery scripts for SlideShows. I saw a couple of them, but the scripts assumed that the number of image tags has to be fixed beforehand. The code given below is taken from my eBook “ 51 Recipes with jQuery and ASP.NET Controls ”. Note: This code was written when jQuery 1.3.2 was the latest version available. Currently we have jQuery 1.4.2 available. < html xmlns ="http://www.w3.org/1999/xhtml"> < head id ="Head1" runat ="server"> < title > Simple Image SlideShow </ title > < link href ="../CSS/Demos.css" rel ="stylesheet" type ="text/css" /> < script type ='text/javascript' src ='../Scripts/jquery-1.3.2.min.js'> </ script > < script type ="text/javascript"> $( function () { var imgs = [ '../images/1.jpg' , ...

Creating groups and summaries in Grid View

GridView has a lot of improvements over the DataGrid but it still lacks some very important features. A recurring requirement not available in the GridView is to create groups and summaries. To create summaries we can easily code the RowDataBound event. Grouping is a more complex task, and involves more coding and debugging. But when we need to combine these two features the things really start to get messy. With this in mind I have implemented the GridViewHelper, as the name suggests, a helper class to aid the creation of groups and summaries. [ Online sample ] [ Download source code ] Using the GridViewHelper Below we will see some GridViewHelper samples. First we show the grid to which the groups and summaries will be created. The sample data comes from Northwind database, with a few modifications: ShipRegion ShipName OrderId ProductName Quantity UnitPrice ItemTotal NM Old Worl...