hyperlink click event?

Discussion in 'ASP .Net' started by Guest, Nov 18, 2003.

  1. Guest

    Guest Guest

    Does anyone know how to trigger the click event of a
    hyperlink control programmatically?

    Thanks for helping.
     
    Guest, Nov 18, 2003
    #1
    1. Advertising

  2. A hyperlink doesn't generate a server-side click event - a hyperlink is a
    client-side event. What you would need to do is create a JavaScript that
    navigates to the page that you want - and you can use the DOM to navigate to
    the <a> element and grab the href that you want for a window.navigate or
    window.open.

    --
    Chris Jackson
    Software Engineer
    Microsoft MVP - Windows Shell/UI
    Windows XP Associate Expert
    --
    More people read the newsgroups than read my email.
    Reply to the newsgroup for a faster response.
    (Control-G using Outlook Express)
    --

    <> wrote in message
    news:06ee01c3adef$33091c90$...
    >
    > Does anyone know how to trigger the click event of a
    > hyperlink control programmatically?
    >
    > Thanks for helping.
     
    Chris Jackson, Nov 18, 2003
    #2
    1. Advertising

  3. Guest

    Guest Guest

    can I use VB.Net instead.
    >-----Original Message-----
    >A hyperlink doesn't generate a server-side click event -

    a hyperlink is a
    >client-side event. What you would need to do is create a

    JavaScript that
    >navigates to the page that you want - and you can use the

    DOM to navigate to
    >the <a> element and grab the href that you want for a

    window.navigate or
    >window.open.
    >
    >--
    >Chris Jackson
    >Software Engineer
    >Microsoft MVP - Windows Shell/UI
    >Windows XP Associate Expert
    >--
    >More people read the newsgroups than read my email.
    >Reply to the newsgroup for a faster response.
    >(Control-G using Outlook Express)
    >--
    >
    ><> wrote in message
    >news:06ee01c3adef$33091c90$...
    >>
    >> Does anyone know how to trigger the click event of a
    >> hyperlink control programmatically?
    >>
    >> Thanks for helping.

    >
    >
    >.
    >
     
    Guest, Nov 18, 2003
    #3
  4. If you want to do that, you'll be wanting to use a LinkButton control, not a
    Hyperlink control.

    Regards,
    Anthony

    <> wrote in message
    news:087d01c3adf2$254d9c40$...
    > can I use VB.Net instead.
    > >-----Original Message-----
    > >A hyperlink doesn't generate a server-side click event -

    > a hyperlink is a
    > >client-side event. What you would need to do is create a

    > JavaScript that
    > >navigates to the page that you want - and you can use the

    > DOM to navigate to
    > >the <a> element and grab the href that you want for a

    > window.navigate or
    > >window.open.
    > >
    > >--
    > >Chris Jackson
    > >Software Engineer
    > >Microsoft MVP - Windows Shell/UI
    > >Windows XP Associate Expert
    > >--
    > >More people read the newsgroups than read my email.
    > >Reply to the newsgroup for a faster response.
    > >(Control-G using Outlook Express)
    > >--
    > >
    > ><> wrote in message
    > >news:06ee01c3adef$33091c90$...
    > >>
    > >> Does anyone know how to trigger the click event of a
    > >> hyperlink control programmatically?
    > >>
    > >> Thanks for helping.

    > >
    > >
    > >.
    > >
     
    Anthony Williams, Nov 18, 2003
    #4
  5. You can use VBScript, if all of your clients will be using Internet
    Explorer.

    --
    Chris Jackson
    Software Engineer
    Microsoft MVP - Windows Shell/UI
    Windows XP Associate Expert
    --
    More people read the newsgroups than read my email.
    Reply to the newsgroup for a faster response.
    (Control-G using Outlook Express)
    --

    <> wrote in message
    news:087d01c3adf2$254d9c40$...
    > can I use VB.Net instead.
    > >-----Original Message-----
    > >A hyperlink doesn't generate a server-side click event -

    > a hyperlink is a
    > >client-side event. What you would need to do is create a

    > JavaScript that
    > >navigates to the page that you want - and you can use the

    > DOM to navigate to
    > >the <a> element and grab the href that you want for a

    > window.navigate or
    > >window.open.
    > >
    > >--
    > >Chris Jackson
    > >Software Engineer
    > >Microsoft MVP - Windows Shell/UI
    > >Windows XP Associate Expert
    > >--
    > >More people read the newsgroups than read my email.
    > >Reply to the newsgroup for a faster response.
    > >(Control-G using Outlook Express)
    > >--
    > >
    > ><> wrote in message
    > >news:06ee01c3adef$33091c90$...
    > >>
    > >> Does anyone know how to trigger the click event of a
    > >> hyperlink control programmatically?
    > >>
    > >> Thanks for helping.

    > >
    > >
    > >.
    > >
     
    Chris Jackson, Nov 18, 2003
    #5
    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. Purvi T
    Replies:
    0
    Views:
    864
    Purvi T
    Oct 19, 2004
  2. Pat

    click event of the hyperlink

    Pat, Nov 17, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    498
    Scott M.
    Nov 18, 2003
  3. Chu
    Replies:
    2
    Views:
    911
    Winista
    Apr 10, 2006
  4. Max2006
    Replies:
    2
    Views:
    1,585
    Walter Wang [MSFT]
    Sep 19, 2007
  5. Ken
    Replies:
    1
    Views:
    390
    Alvin Bruney
    Aug 16, 2003
Loading...

Share This Page