ASP problem, ideas needed ;-)

Discussion in 'ASP General' started by Avlan, Feb 11, 2006.

  1. Avlan

    Avlan Guest

    Hi all,

    I'm pretty new at asp-coding, but I'm getting stuff to work.

    I now have the problem that, after someone has made a query, returning,
    say, 10 contacts (name/addresses in a simple table), I want the user to
    be able to CLICK on one of the names in the list, and thus be
    redirected to a new page where details about the selected user will be
    available.

    Now I've tried to create the last names as hyperlinks, which of course
    works fine, but I now have the problem that the user is redirected to a
    'details.asp'-page, but this way there is no way I can think of to find
    out on which name the user has clicked.

    Needless to say, I do not want to make a different asp-page for every
    contact, but it has to be generated dynamically with the data in the
    DB. But I want the user to click only once (not with radiobuttons or
    post/get-buttons etc), on the name (or row) of the contact.

    Any bright ideas? :)
    Avlan, Feb 11, 2006
    #1
    1. Advertising

  2. Avlan

    Evertjan. Guest

    Avlan wrote on 11 feb 2006 in microsoft.public.inetserver.asp.general:

    > I'm pretty new at asp-coding, but I'm getting stuff to work.
    >
    > I now have the problem that, after someone has made a query, returning,
    > say, 10 contacts (name/addresses in a simple table), I want the user to
    > be able to CLICK on one of the names in the list, and thus be
    > redirected to a new page where details about the selected user will be
    > available.
    >
    > Now I've tried to create the last names as hyperlinks, which of course
    > works fine, but I now have the problem that the user is redirected to a
    > 'details.asp'-page, but this way there is no way I can think of to find
    > out on which name the user has clicked.
    >
    > Needless to say, I do not want to make a different asp-page for every
    > contact, but it has to be generated dynamically with the data in the
    > DB. But I want the user to click only once (not with radiobuttons or
    > post/get-buttons etc), on the name (or row) of the contact.
    >


    This is mainly an clientside problem:

    <tr><td onclick='redir(this)'>myLastName</td></tr>

    <script type='text/javascript'> // clientside!
    function redir(x){
    location.href='details.asp?r='+escape(x.innerHTML)
    }
    </script>

    Not tested

    ======== details.asp ==========

    <%

    r = request.querystring("r")
    ' ......

    %>


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Feb 11, 2006
    #2
    1. Advertising

  3. I would normally use (if there is one) a primary key to show the details,
    just a bit cleaner :)

    generate the hyperlink like:

    <A HREF="details.asp?c=<%=clientId%>"><%=clientName%></A>

    then just do like Evertjan said:

    c = request.querystring("c")

    in details.asp

    Simon

    --
    Evertjan.
    "Avlan" <> wrote in message
    news:...
    >
    > Hi all,
    >
    > I'm pretty new at asp-coding, but I'm getting stuff to work.
    >
    > I now have the problem that, after someone has made a query, returning,
    > say, 10 contacts (name/addresses in a simple table), I want the user to
    > be able to CLICK on one of the names in the list, and thus be
    > redirected to a new page where details about the selected user will be
    > available.
    >
    > Now I've tried to create the last names as hyperlinks, which of course
    > works fine, but I now have the problem that the user is redirected to a
    > 'details.asp'-page, but this way there is no way I can think of to find
    > out on which name the user has clicked.
    >
    > Needless to say, I do not want to make a different asp-page for every
    > contact, but it has to be generated dynamically with the data in the
    > DB. But I want the user to click only once (not with radiobuttons or
    > post/get-buttons etc), on the name (or row) of the contact.
    >
    > Any bright ideas? :)
    >
    Simon O'Beirne, Feb 11, 2006
    #3
  4. Avlan

    Avlan Guest

    Yeh the thought came to me too, adding the parameters in the redirect..
    :)

    I just though that that was kind of a crude way to do it, and that
    there would be some way to make a clickable link which (when clicked)
    can send some info with the redirect, but apparently this is not
    possible (or very hard)..

    So thanks for the confirmation, apparently this is the way to go! It
    works like a charm, so I'm happy anyway ;-)
    Avlan, Feb 12, 2006
    #4
    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. greg
    Replies:
    0
    Views:
    439
  2. Daves
    Replies:
    5
    Views:
    628
    =?Utf-8?B?YWpheHRvZGF5?=
    Apr 3, 2006
  3. iksrazal

    Huge DB query ideas needed

    iksrazal, Mar 9, 2005, in forum: Java
    Replies:
    0
    Views:
    411
    iksrazal
    Mar 9, 2005
  4. Lit
    Replies:
    21
    Views:
    1,714
    Brandon Gano
    Jul 24, 2007
  5. Ryan Macy

    Ideas needed & help needed!

    Ryan Macy, Jul 19, 2006, in forum: Ruby
    Replies:
    2
    Views:
    493
    Ryan Macy
    Jul 19, 2006
Loading...

Share This Page