Activating sub routine from hyperlink

Discussion in 'ASP General' started by Ruskin Hardie, Feb 19, 2004.

  1. Ok, I am still playing with ASP and was wondering how to do this (it seemed
    simple). What I want is to have a hyperlink that when it's clicked on, will
    run a sub routine, instead of opening a web page... Right now I have;

    Sub CreateLinks()
    Response.Write "<br><br>"
    Response.Write "<a href='OpenAllOrders()'>1. All Orders</a><br>"
    Response.Write "<a href='OpenCustOrders()'>2. Customer Orders</a><br>"
    Response.Write "<a href='OpenInvoices.asp'>3. Open Invoices</a><br>"
    End Sub

    Sub OpenAllOrders()
    Response.Redirect "OpenOrders.asp?Customer=0"
    End Sub

    Sub OpenCustOrders()
    Response.Redirect "OpenOrders.asp?Customer=1"
    End Sub


    The issue, is that clicking on the link, tries to open a web page file of
    'openallorders()', instead of running the sub routine. Obviously I am
    missing something simple... Can anyone point me in the correct direction
    (think it has something to do with href... maybe it should be hsub or
    something).
    Ruskin Hardie, Feb 19, 2004
    #1
    1. Advertising

  2. Thanks for that Curt... But now I am more confused... How do I determine if
    it is client or server side? How do I call the sub routine (on my servers
    asp page), from a link? Can it be done?


    "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    news:...
    > the click has two choices.
    > 1) run a CLIENTSIDE event/function/etc
    > or
    > 2) post back and run a SERVER event/function/etc.
    >
    > Can't have a clientside anything do a serverside anything
    >
    > --
    > Curt Christianson
    > Owner/Lead Developer, DF-Software
    > www.Darkfalz.com
    >
    >
    > "Ruskin Hardie" <> wrote in message
    > news:i69Zb.49686$...
    > > Ok, I am still playing with ASP and was wondering how to do this (it

    > seemed
    > > simple). What I want is to have a hyperlink that when it's clicked on,

    > will
    > > run a sub routine, instead of opening a web page... Right now I have;
    > >
    > > Sub CreateLinks()
    > > Response.Write "<br><br>"
    > > Response.Write "<a href='OpenAllOrders()'>1. All Orders</a><br>"
    > > Response.Write "<a href='OpenCustOrders()'>2. Customer

    Orders</a><br>"
    > > Response.Write "<a href='OpenInvoices.asp'>3. Open Invoices</a><br>"
    > > End Sub
    > >
    > > Sub OpenAllOrders()
    > > Response.Redirect "OpenOrders.asp?Customer=0"
    > > End Sub
    > >
    > > Sub OpenCustOrders()
    > > Response.Redirect "OpenOrders.asp?Customer=1"
    > > End Sub
    > >
    > >
    > > The issue, is that clicking on the link, tries to open a web page file

    of
    > > 'openallorders()', instead of running the sub routine. Obviously I am
    > > missing something simple... Can anyone point me in the correct direction
    > > (think it has something to do with href... maybe it should be hsub or
    > > something).
    > >
    > >

    >
    >
    Ruskin Hardie, Feb 19, 2004
    #2
    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. D. Shane Fowlkes

    just tinkering with a Sub Routine in ASP.NET

    D. Shane Fowlkes, Nov 12, 2003, in forum: ASP .Net
    Replies:
    5
    Views:
    425
    Scott M.
    Nov 13, 2003
  2. Ben
    Replies:
    2
    Views:
    859
  3. Lawrence D'Oliveiro

    Death To Sub-Sub-Sub-Directories!

    Lawrence D'Oliveiro, May 5, 2011, in forum: Java
    Replies:
    92
    Views:
    1,962
    Lawrence D'Oliveiro
    May 20, 2011
  4. niv
    Replies:
    3
    Views:
    140
    Ken Schaefer
    Sep 15, 2003
  5. niv

    activating a hyperlink

    niv, Sep 15, 2003, in forum: ASP General
    Replies:
    2
    Views:
    142
Loading...

Share This Page