472,958 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

how to get javascript variable value into asp variable

Hi,

if I have both javascript and aspscript,

how to get/retrieve the variable value in javascript into asp variable ?

regards
hoe
Jul 23 '05 #1
4 12289
*** tnhoe wrote/escribió (Mon, 28 Mar 2005 12:19:23 +0800):
if I have both javascript and aspscript,
What is aspscript?

how to get/retrieve the variable value in javascript into asp variable ?


If you mean client-side JavaScript, you have these options:

* Cookies (not 100% reliable)
* GET
* POST
--
-- Álvaro G. Vicario - Burgos, Spain
-- Don't e-mail me your questions, post them to the group
--
Jul 23 '05 #2
In article <42**********@news.tm.net.my>, tn***@pc.jaring.my enlightened us
with...
Hi,

if I have both javascript and aspscript,

how to get/retrieve the variable value in javascript into asp variable ?


Clarify what you mean.
There is no such thing as aspscript.

ASP[.net] is a framework.
It can run javascript (jscript), vbscript, and other languages on the SERVER
SIDE.
MSIE can use vbscript or javascript on the CLIENT-side.
All other browsers can use javascript on the CLIENT-side.

So, are you trying to share variables all on the client, all on the server,
from the server to the client, or from the client to the server?

You can easily write values from the server to the client.
To get stuff from the client to the server in an ASP.net environment, use
postback. Any other environment (including classic ASP), you have to
specifically make a request to the server as either a form submission, get
params (url) or other means (img tag that calls script, etc).

--
--
~kaeli~
"When dogma enters the brain, all intellectual activity
ceases" -- Robert Anton Wilson
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #3
"tnhoe" <tn***@pc.jaring.my> wrote:
Hi,

if I have both javascript and aspscript,

how to get/retrieve the variable value in javascript into asp variable ?


The Javascript is (presumably) running on the client *after* the ASP
code has run on the server and created the page. So, by the time the
Javascript variable is created, the ASP code has finished and no
longer exists.

Tell us what you're trying to do, maybe we can suggest something.

--
Tim Slattery
Sl********@bls.gov
Jul 23 '05 #4
>how to get/retrieve the variable value in javascript into
asp variable ?


Well, as others have said, this doesn't make sense. But to pass a
variable to ASP you use a form with get or post, or a URL that fakes a
get (like onClick="location=./submit.asp?clr=yellow&size=xlarge").

In ASP, for a post use Request.Form("clr"), for get use
Request.QueryString("size"), in the case of my code from above.

To put ASP into HTML or Javascript, just use <%= VariableName %>, so in
Javascript you could have

var TheColor = '<%= ColorVal %>'

Hope this helps,
A.L.
If I were you I would go to an ASP site, like
http://www.4guysfromrolla.com for basic concepts like this...

Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.