Results 1 to 3 of 3

Thread: Help!Changing the value of session variables on client side via an event or other way

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    28
    Help! Is it possible to change the value of a session variable on the client side such as via an onclick or onmouseover event? I would like to be able to click on a URL that goes to an ASP file and have the ASP file know some information based on which URL was clicked. For example, I have a table of contents type listing of URL’s that all navigate to the same asp file.

    <A HREF =”query.asp” id=”Number_1” > Number 1 </A>
    <A HREF =”query.asp” id=”Number_2” > Number 2 </A>
    <A HREF =”query.asp” id=”Number_3” > Number 3 </A>
    <A HREF =”query.asp” id=”Number_4” > Number 4 </A>
    <A HREF =”query.asp” id=”Number_5” > Number 5 </A>
    <A HREF =”query.asp” id=”Number_6” > Number 6 </A>
    <A HREF =”query.asp” id=”Number_7” > Number 7 </A>
    <A HREF =”query.asp” id=”Number_8” > Number 8 </A>
    <A HREF =”query.asp” id=”Number_9” > Number 9 </A>
    <A HREF =”query.asp” id=”Number_10” > Number 10 </A>
    <A HREF =”query.asp” id=”Number_11” > Number 11 </A>
    <A HREF =”query.asp” id=”Number_12” > Number 12 </A>
    <A HREF =”query.asp” id=”Number_13” > Number 13 </A>
    <A HREF =”query.asp” id=”Number_14” > Number 14 </A>

    Upon clicking the desired URL, I need for the query.asp to know which one of the URL’s was clicked because I want to query a database for different information depending on which one was clicked. I don’t want to do this using a form with a button and I don’t want to have 14 query.asp files that are essentially identical other than the fact that they will query a database in a slightly different manner based on a single variable being different. I thought the easiest thing to do would be to change the value of a session variable based on a click event for the Anchor tag but I didn’t have much luck. Any help would be greatly appreciated.

    Thanks,
    KBH

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    then use querystrings

    <A HREF =”query.asp?id=Number_1 > Number 1 </A>
    <A HREF =”query.asp?id=Number_2 > Number 2 </A>
    <A HREF =”query.asp?id=Number_3 > Number 3 </A>

    Then you can use request.querystring("id") to get the value.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    28

    Thanks very much Cander.

    Thanks very much Cander.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width