ASP.NET Navigate to an anchor in a 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 >
    <ItemTemplate>
        <a name='<%# Eval("anchor") %>'  ></a>
    </ItemTemplate>
</telerik:GridTemplateColumn>

Navigating:

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


RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences