Setting focus on top of the page on click of asp.net link button

Posted by user74042 on Stack Overflow See other posts from Stack Overflow or by user74042
Published on 2009-06-19T21:22:04Z Indexed on 2010/05/24 22:41 UTC
Read the original article Hit count: 233

Filed under:
|

I've a asp.net datagrid which shows customer order details. Pagination at the bottom of the grid is done using datalist and asp.net Linkbutton controls. Here is the code:

 <asp:DataList ID="DataList2" runat="server" CellPadding="1" CellSpacing="1" OnItemCommand="DataList2_ItemCommand"
                                        OnItemDataBound="DataList2_ItemDataBound" RepeatDirection="Horizontal">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="lnkbtnPaging" runat="server" CommandArgument='<%# Eval("PageIndex") %>'
                                                CommandName="lnkbtnPaging" Text='<%# Eval("PageText") %>'></asp:LinkButton>
                                            <asp:Label runat="server" ID="lblPageSeparator" Text=" | " name=></asp:Label>
                                        </ItemTemplate>
                                    </asp:DataList>

When the user clicks on any page number(ie.Link button), I need to set focus on top of the page. How do i do this?

Thanks!

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET