moving to an anchor point programmatically

Discussion in 'ASP .Net' started by Craig Phillips, Jul 3, 2003.

  1. Hi,
    Does anyone know how to programmatically move to a anchor point (a tag). I
    am using vb.net. When the user presses a server-side control on the webpage,
    I need to do some server processing and then I would like the resultant page
    to have scrolled down half-way to the relevent part. Any help much
    appreciated.
    Craig Phillips, Jul 3, 2003
    #1
    1. Advertising

  2. When the page posts back, use RegisterStartUpScript() to add a script like
    the following to your page, to be run as soon as the page loads:

    <script type="text/javascript"><!--
    document.location = "#tagName";
    // --></script>

    HTH,

    Kevin Spencer
    Microsoft FrontPage MVP
    Internet Developer
    http://www.takempis.com
    Some things just happen.
    Everything else occurs.

    "Craig Phillips" <> wrote in message
    news:uM1m%...
    > Hi,
    > Does anyone know how to programmatically move to a anchor point (a tag). I
    > am using vb.net. When the user presses a server-side control on the

    webpage,
    > I need to do some server processing and then I would like the resultant

    page
    > to have scrolled down half-way to the relevent part. Any help much
    > appreciated.
    >
    >
    Kevin Spencer, Jul 3, 2003
    #2
    1. Advertising

  3. The easy way is to do a response.redirect to that spot:

    Response.Redirect("mypage.aspx#tagName")

    Note, however, that this forces two calls from the client. Not a problem if
    you are using viewState and do not have a very large viewState, but not
    optimal in all situations. Note, also, that this is largely an HTML/HTTP
    problem.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA
    Author: ADO.NET and XML: ASP.NET on the Edge

    ****************************************************************************
    ****
    Think Outside the Box!
    ****************************************************************************
    ****
    "Craig Phillips" <> wrote in message
    news:uM1m%...
    > Hi,
    > Does anyone know how to programmatically move to a anchor point (a tag). I
    > am using vb.net. When the user presses a server-side control on the

    webpage,
    > I need to do some server processing and then I would like the resultant

    page
    > to have scrolled down half-way to the relevent part. Any help much
    > appreciated.
    >
    >
    Cowboy \(Gregory A. Beamer\), Jul 3, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Flokke

    Anchor point problem

    Flokke, Sep 19, 2003, in forum: HTML
    Replies:
    2
    Views:
    559
    Hywel Jenkins
    Sep 19, 2003
  2. linkswanted
    Replies:
    0
    Views:
    722
    linkswanted
    Dec 21, 2007
  3. linkswanted
    Replies:
    0
    Views:
    1,542
    linkswanted
    Jan 6, 2008
  4. Saraswati lakki
    Replies:
    0
    Views:
    1,295
    Saraswati lakki
    Jan 6, 2012
  5. Robert Mark Bram
    Replies:
    1
    Views:
    126
    GĂ©rard Talbot
    Nov 8, 2005
Loading...

Share This Page