Transferring a A ID to ASP?

Discussion in 'Javascript' started by Michael Kragh Pedersen, Feb 20, 2005.

  1. I have four links, and depending on which of those, I click, I want to
    either increment or decrement a variable with some value. I have earlier
    been told how to do that, but I was wondering, how I can check, in ASP
    (if at all possible), which of the four links, I have clicked? I was
    thinking about something like checking for the ID in the A element, but
    I don't know if that's possible?

    Michael K. P.
     
    Michael Kragh Pedersen, Feb 20, 2005
    #1
    1. Advertising

  2. Michael Kragh Pedersen wrote:

    > I have four links, and depending on which of those, I click, I want to
    > either increment or decrement a variable with some value. I have earlier
    > been told how to do that, but I was wondering, how I can check, in ASP
    > (if at all possible), which of the four links, I have clicked? I was
    > thinking about something like checking for the ID in the A element, but
    > I don't know if that's possible?


    <a href="whatever.asp?increment=1&amp;id=link1">link 1</a>
    <a href="whatever.asp?increment=1&amp;id=link2">link 2</a>
    Then in whatever.asp check
    Request.QueryString("id")

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Feb 20, 2005
    #2
    1. Advertising

  3. Michael Kragh Pedersen

    Marek Mänd Guest

    Michael Kragh Pedersen wrote:
    > I have four links, and depending on which of those, I click, I want to
    > either increment or decrement a variable with some value. I have earlier
    > been told how to do that, but I was wondering, how I can check, in ASP
    > (if at all possible), which of the four links, I have clicked? I was
    > thinking about something like checking for the ID in the A element, but
    > I don't know if that's possible?


    This is not a JavaScript question, it is offtopic here.
    It has nothing to do with javascript.

    Your question is ontopic in newsgroup
    microsoft.public.inetserver.asp.general
    or something similar.


    But short answer is -
    you write your hyperlinks in manner
    http://www.yourserver.com/index.asp?whatlink=firstlink
    http://www.yourserver.com/index.asp?whatlink=secondlink
    ....
    http://www.yourserver.com/index.asp?whatlink=fourthlink

    On the server side you extract the "whatlink" value, what is the ID, you
    can name it basically whatever you want and make decision based on its
    value what to do.

    Please go to
    microsoft.public.inetserver.asp.general
    adn ask there, your possible future ASP questions are not ontopic here,
    so it is wise for you to subscribe to that NG.


    HTH
     
    Marek Mänd, Feb 20, 2005
    #3
  4. Marek Mänd wrote:
    > Michael Kragh Pedersen wrote:
    >
    >> I have four links, and depending on which of those, I click, I want to
    >> either increment or decrement a variable with some value. I have
    >> earlier been told how to do that, but I was wondering, how I can
    >> check, in ASP (if at all possible), which of the four links, I have
    >> clicked? I was thinking about something like checking for the ID in
    >> the A element, but I don't know if that's possible?

    >
    >
    > This is not a JavaScript question, it is offtopic here.
    > It has nothing to do with javascript.
    >
    > Your question is ontopic in newsgroup
    > microsoft.public.inetserver.asp.general
    > or something similar.
    >
    >
    > But short answer is -
    > you write your hyperlinks in manner
    > http://www.yourserver.com/index.asp?whatlink=firstlink
    > http://www.yourserver.com/index.asp?whatlink=secondlink
    > ...
    > http://www.yourserver.com/index.asp?whatlink=fourthlink
    >
    > On the server side you extract the "whatlink" value, what is the ID, you
    > can name it basically whatever you want and make decision based on its
    > value what to do.
    >
    > Please go to
    > microsoft.public.inetserver.asp.general
    > adn ask there, your possible future ASP questions are not ontopic here,
    > so it is wise for you to subscribe to that NG.
    >
    >
    > HTH

    Sheesh, of course, it is for this newsgroup, I figured, it would have to
    be done in JavaScript, why else would I write it here?

    Anyway, the problem is, (which I forgot to write unfortunately), that I
    don't really want to transfer with the URL, but in some other way, if
    possible.

    Michael K. P.
     
    Michael Kragh Pedersen, Feb 20, 2005
    #4
  5. Michael Kragh Pedersen

    Lee Guest

    Michael Kragh Pedersen said:
    >
    >Marek Mänd wrote:
    >> Michael Kragh Pedersen wrote:
    >>
    >>> I have four links, and depending on which of those, I click, I want to
    >>> either increment or decrement a variable with some value. I have
    >>> earlier been told how to do that, but I was wondering, how I can
    >>> check, in ASP (if at all possible), which of the four links, I have
    >>> clicked? I was thinking about something like checking for the ID in
    >>> the A element, but I don't know if that's possible?

    >>
    >>
    >> This is not a JavaScript question, it is offtopic here.
    >> It has nothing to do with javascript.
    >>
    >> Your question is ontopic in newsgroup
    >> microsoft.public.inetserver.asp.general
    >> or something similar.
    >>
    >>
    >> But short answer is -
    >> you write your hyperlinks in manner
    >> http://www.yourserver.com/index.asp?whatlink=firstlink
    >> http://www.yourserver.com/index.asp?whatlink=secondlink
    >> ...
    >> http://www.yourserver.com/index.asp?whatlink=fourthlink
    >>
    >> On the server side you extract the "whatlink" value, what is the ID, you
    >> can name it basically whatever you want and make decision based on its
    >> value what to do.
    >>
    >> Please go to
    >> microsoft.public.inetserver.asp.general
    >> adn ask there, your possible future ASP questions are not ontopic here,
    >> so it is wise for you to subscribe to that NG.
    >>
    >>
    >> HTH

    >Sheesh, of course, it is for this newsgroup, I figured, it would have to
    >be done in JavaScript, why else would I write it here?
    >
    >Anyway, the problem is, (which I forgot to write unfortunately), that I
    >don't really want to transfer with the URL, but in some other way, if
    >possible.


    ASP code is executed on the server before the page is sent to the
    browser. The only way to pass anything to ASP is by sending another
    HTTP request. What you're asking for seems to be two-way real-time
    communication between two systems that are never operating at the
    same time.


    to the server.
     
    Lee, Feb 20, 2005
    #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. Mark
    Replies:
    10
    Views:
    751
    Joe Smith
    Jul 23, 2004
  2. Jack Fox
    Replies:
    0
    Views:
    327
    Jack Fox
    Dec 2, 2003
  3. =?Utf-8?B?UmFuamFuIGFzIHVzdWFs?=

    Transferring ASP .net program from test box to server

    =?Utf-8?B?UmFuamFuIGFzIHVzdWFs?=, May 27, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    268
    Chad A. Beckner
    May 27, 2004
  4. Stimp
    Replies:
    9
    Views:
    312
    Juan T. Llibre
    Dec 14, 2006
  5. Lee
    Replies:
    3
    Views:
    129
    Ray Costanzo [MVP]
    Apr 22, 2005
Loading...

Share This Page