show-notice
hide-notice

Thursday 4 July 2013

PagingBulletedListExtender IndexSize in asp.net ajax




Introduction: 



PagingBulletedList is an ASP.NET AJAX extender that can be attached to an ASP.NET BulletedList control and provide client-side sorted paging. It is very flexible and lets you specify either the number of characters used in the heading indices or the maximum number of items to display per index. If the input is not sorted (either on the server or client), it will generated more header indices but still function appropriately.




<%@ Page Language="C#" AutoEventWireup="true" %>

<%@ Import Namespace="System.Drawing" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server"> 
        protected void Page_Load(object sender, EventArgs e) 
        { 
            if(!Page.IsPostBack) 
            { 
                BulletedList1.ForeColor = Color.Red; 
                BulletedList1.Font.Name = "Verdana"; 
                BulletedList1.Font.Size = FontUnit.Medium; 
            } 
        } 
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Ajax PagingBulletedListExtender IndexSize - How to use IndexSize</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color: OrangeRed; font-style: italic;">
            Ajax PagingBulletedListExtender Example: Using IndexSize</h2>
        <hr width="575" align="left" color="Orange" />
        <br />
        <br />
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
            SelectCommand="Select Top 25 ProductID, ProductName From Products"></asp:SqlDataSource>
        <cc1:PagingBulletedListExtender ID="PagingBulletedListExtender1" runat="server" TargetControlID="BulletedList1"
            IndexSize="2">
        </cc1:PagingBulletedListExtender>
        <asp:BulletedList ID="BulletedList1" runat="server" DataSourceID="SqlDataSource1"
            DataValueField="ProductID" DataTextField="ProductName">
        </asp:BulletedList>
    </div>
    </form>
</body>
</html>








SHARE THIS POST   

0 comments :

Post a Comment

Design by Gohilinfotech | www.gohilinfotech.blogspot.com