A small problem of JavaScript interaction with the server

Source: Internet
Author: User
You must have used a very common scenario of JS interaction with the server. (If you have time, summarize the interaction between the server and the client script)
As follows:
The server obtains the value of a hidden control:

< Input Type = "Hidden" ID = "Allscore" Value = "" Runat = "Server" />

you need to assign a value to it using JS and obtain it on the server.
the scenario is very simple.
then, let's see how to assign a value to it using JS: var allscore = document. getelementbyid ( " allscore " ). value;
var temp = 123 ;
allscore = temp; alert (allscore);

Obviously, allscore = 123 can be obtained, but on the server side,
Allscore =... is always blank and no value is obtained. Crazy ~
I thought about it for a long time ~
Only consult experts.
Last changedVaRAllscore=Document. getelementbyid ("Allscore");
Allscore. Value=Temp;

Done ~
It's really depressing. I don't know how to explain it. That expert doesn't know how to explain it. It's just experience ~
Did anyone tell me?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.