Navigating to a bookmark on page?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Carnahan

    #1

    Navigating to a bookmark on page?

    How would I accomplish the following ?
    Navigate to a bookmark on a page from a routine in the code behind.

    ---- html code

    bookmark1 (someplace on the page... is this an htmlanchor?)
    ?? how do I define the bookmark??

    bookmark2 (somwhere else down the page)

    -----

    --- Code behind file

    Sub GotoBookmark(by Val myBookmark As String)
    ' what goes here ??
    ?? NavigateToBookm ark(myBookMark) ????
    End Sub


  • George Durzi

    #2
    Re: Navigating to a bookmark on page?

    I don't think it's doable on the server side. I just do a Redirect to the
    same page, and put the anchor in the URL,



    "John Carnahan" <carnahan_j@msn .com> wrote in message
    news:uakETIgqDH A.2404@TK2MSFTN GP12.phx.gbl...[color=blue]
    > How would I accomplish the following ?
    > Navigate to a bookmark on a page from a routine in the code behind.
    >
    > ---- html code
    >
    > bookmark1 (someplace on the page... is this an htmlanchor?)
    > ?? how do I define the bookmark??
    >
    > bookmark2 (somwhere else down the page)
    >
    > -----
    >
    > --- Code behind file
    >
    > Sub GotoBookmark(by Val myBookmark As String)
    > ' what goes here ??
    > ?? NavigateToBookm ark(myBookMark) ????
    > End Sub
    >
    >[/color]


    Comment

    • alex bowers

      #3
      Navigating to a bookmark on page?

      Hi
      this can be done. The html bookmark code is of the form
      <A name='#bookmark 1'></A>"
      The server code that causes the browser to jump to it is
      a script function that runs when the page loads
      string script = "<SCRIPT
      language='javas cript'>location .href='#bookmar k';</SCRIPT>"
      ;
      Page.RegisterSt artupScript("st artupscript",sc ript);

      alex
      [color=blue]
      >-----Original Message-----
      >How would I accomplish the following ?
      >Navigate to a bookmark on a page from a routine in the[/color]
      code behind.[color=blue]
      >
      >---- html code
      >
      > bookmark1 (someplace on the page... is this an[/color]
      htmlanchor?)[color=blue]
      > ?? how do I define the bookmark??
      >
      > bookmark2 (somwhere else down the page)
      >
      >-----
      >
      >--- Code behind file
      >
      > Sub GotoBookmark(by Val myBookmark As String)
      > ' what goes here ??
      > ?? NavigateToBookm ark[/color]
      (myBookMark) ????[color=blue]
      > End Sub
      >
      >
      >.
      >[/color]

      Comment

      • John Carnahan

        #4
        Re: Navigating to a bookmark on page?

        Alex,
        Thanks alot...
        worked perfectly!
        John


        Comment

        Working...