sgray128 9/30/2015 10:35:26 AM

ASP.NET Navigate to an anchor in a RadGrid

This article demonstrates two techniques to navigate to an anchor in an ASP.NET RadGrid


I found two different situations that needed to be addressed. In the first, I did a postback from a RadGrid and on postback I wanted to return to the same spot in the grid. That was fixed by placing this tag in the page directive at the top of the page:


<%@ Page Title="" MaintainScrollPositionOnPostback="true" ...

The second is a two page thing. We place html anchor tags in the grid, and then reference the anchor when navigating to the page:

The anchor tag. Note that I had issues with anchors with spaces in them, I had to remove the spaces:


<telerik:GridTemplateColumn >
        <a name='<%# Eval("anchor") %>'  ></a>


Response.Redirect(String.Format("PO Approval.aspx#{0}", strAnchor))