AlbumOnNet WebControl Suite

Album.SetPagedAlbum Method 

Helper method to be called when having a pageable Album.

[Visual Basic]
Public Sub SetPagedAlbum()
[C#]
public void SetPagedAlbum();

Remarks

SetPageAlbum is a helper method that should be used when creating a paged Album. You will need to set AllowPaging=true and follow the pattern displayed in the code below. For a complete working example see the Sample application supplied with AlbumOnNet.

Example

[aspx]

<form id=Form1 method=post runat="server">
            
            <table cellpadding="0" cellspacing="2" border="0" width="800">
            <tr>
            <td colspan="3" align="center">
            <axp:slideshow id=SlideShow1 runat="server" ScalingType="MaximumSize" 
            ScaleHeight="255" ScaleWidth="400" 
            AutoStart="False" BorderStyle="None" Width="400px" Height="255px" 
            ImageBorderColor="Gainsboro" ImageBorderStyle="Outset" ImageBorderWidth="2px">
            <StaticFilters>
            <axp:StaticFilter FilterProperties="color=gold" FilterType="Glow"></axp:StaticFilter>
            </StaticFilters>
            </axp:slideshow>		
            </td>
            </tr>
            <tr>
            <td width="40"><asp:ImageButton Id="BtnPrevious" runat="server" 
            ImageUrl="skins/default/blueleft.gif"></asp:ImageButton></td>
            <td align="center">
            <axp:album id=Album1 runat="server" BorderStyle="Ridge" 
            AlbumUrl="albums/album1/" SlideShowControl="SlideShow1" 
            Font-Names="Tahoma" Font-Size="8pt" ForeColor="White" AllowPaging="True" 
            PageSize="6" BorderColor="#404040" CellPadding="0" CellSpacing="1" DisplayText="False">
            <ItemStyle Wrap="False" HorizontalAlign="Center">
            </ItemStyle>
            </axp:album>		
            </td>
            <td width="40"><asp:ImageButton Id="BtnNext" runat="server" 
            ImageUrl="skins/default/blueright.gif"></asp:ImageButton></td>
            </tr>
            <tr>
            <td></td>
            <td align="center">
            	 <asp:label id=lblCurrentPage runat="server" Font-Names="Trebuchet MS" 
            	 Font-Size="12px" ForeColor="White"></asp:label>
            </td>
            <td></td>
            </tr>
            </table>
            </form>
             
[C# Code behind extract]
private void Page_Load(object sender, System.EventArgs e)
            {
            if (!Page.IsPostBack)
            SetPagedAlbum();
            }
            
            private void SetPagedAlbum()
            {	
            Album1.SetPagedAlbum();
            
            lblCurrentPage.Text = "Page " + (Album1.PageIndex + 1).ToString() + " of " + Album1.PageCount.ToString();
            BtnPrevious.Visible = (Album1.PageIndex != 0);
            BtnNext.Visible = (Album1.PageIndex != Album1.PageCount-1);
            }
            
            private void BtnPrevious_Click(object sender, System.Web.UI.ImageClickEventArgs e)
            {
            Album1.PageIndex--;
            SetPagedAlbum();				
            }
            
            private void BtnNext_Click(object sender, System.Web.UI.ImageClickEventArgs e)
            {
            Album1.PageIndex++;
            SetPagedAlbum();					
            }
             

See Also

Album Class | AlbumOnNet Namespace