locked
Problem with html ANCHOR RRS feed

  • Question

  • Hi,

      I have two WebParts. One of them has hyperLinks with Anchor, f.ex http://win-myhost/sitepages/test.aspx#Anchor.

      In the second WebPart I have the table where I have definied <a name="Anchor" /> but after redirect to this WebPart from this first one as you know there is PostBack and this Anchor doesn't work, so scroll doesn't go down or up after PostBack. How can I make this possibly to scroll to right place where <a name="Anchor" /> is definied after PostBack ? Please help.

    Monday, February 27, 2012 3:41 PM

All replies

  •  

    Hi CaMeL023,

    You can add some C# code in your web part page load.

    Here is the sample code.

    this.RegisterStartupScript ("navigateto","<script
    type='text/javascript'>document.location.href='# Anchor';</script>");
     

    Thanks,

    Jack

    Tuesday, February 28, 2012 7:25 AM
    Moderator