hi. im new here and new in web programming. i was trying to put a pagination for my table, it is working fine but i wanted to change the color of the current page. i found some solution but most of them are in c# and im using vb, im not sure if my codes are correct and thus, im having problem with the commandArgument value. Im always getting "1" eventhough i already click page 2, the result Page 1 always has the properties changed. Please help. thank you in advance. By the way im using an arraylist which is bound to repeater with linkbutton.
Code:
<asp:Repeater ID="rptPages" runat="server">
<HeaderTemplate>
<div style="float: left">Page </div>
</HeaderTemplate>
<ItemTemplate>
<a style="float: left">
<asp:LinkButton ID="btnPage" runat="server"
CommandName="Page" CommandArgument="<%# Container.DataItem%>">
 <%# Container.DataItem%></asp:LinkButton>
</a>
</ItemTemplate>
</asp:Repeater>
Protected Sub rptPages_ItemDataBound(sender As Object, e As RepeaterItemEventArgs) Handles rptPages.ItemDataBound
Dim lnkPage As LinkButton
Dim strPage As Integer
strPage = PageNumber + 1
If e.Item.ItemType = ListItemType.Item Then
lnkPage = e.Item.FindControl("btnPage")
If lnkPage.CommandArgument.ToString() = strPage.ToString() Then
lnkPage.Enabled = False
lnkPage.ForeColor = Drawing.Color.Black
End If
End If
End Sub
Comment