getting the value of a javascript var in ASP *CROS

Results 1 to 3 of 3

Thread: getting the value of a javascript var in ASP *CROS

  1. #1
    Join Date
    Dec 1969

    Default getting the value of a javascript var in ASP *CROS

    Hi all, I knda have this on the javascript Q&A as well. I have a javascript function that I had to jump into ASP and do an if statement while in the script tag. I need to use a javascript variable in that statement and can not figure out how to do it. Has anyone done this?<BR><BR><BR>thanks,<BR><BR>Brian Yager

  2. #2
    Join Date
    Dec 1969

    Default Can't do it because

    Because the JavaScript value is set on the client-side, after the server processing relevant to that code is done. The value can&#039;t be returned to the server to perform a function without going to a new page or refreshing the page.<BR>&#060;script&#062;<BR><BR>myName = Jim<BR><BR>&#060;%<BR><BR>ASP code cannot get the value of myName<BR><BR>I would refresh the page using document.location.href="thisPage.asp?myName=jim"<B R><BR>and then at the top of the page add, in asp: myName = request("myName")<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default ASP then javascript

    the javascript variable is not filled with a value until after the server processing is done...(after the asp has run)... meaning you can&#039;t get the value into asp becuase it isn&#039;t even in java yet.<BR><BR>now you could pass it to a new ASP page, or even back to itself using form posting...<BR><BR>check out &#039;the nature of things&#039; in the ASP FAQs<BR><BR>sponge

Posting Permissions

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