Ajax is the most frequently used method to call the background at the front end. There is no doubt that I will not talk about it here. What I want to talk about today is to use js to call the background method.
We are not familiar with this <% = namevalue %> Method for transmitting values from the background to the foreground. Therefore, can we use the same method to achieve the return value of the value transfer method?
What I first thought about in this project is to try this (because VML is used in this project and Ajax is not used before. However, there is no problem in testing later,, the xmlns = http://www.w3.org/5o/xhtmlto be retained) method is feasible. However, because the front-end needs to call the background method, you need to first pass the parameter to it.
After reading some solutions on the Internet, the strings are passed as parameters, and more netizens Want To Know How To pass variables, because this variable
The value of is uncertain! In the background, I got help from a netizen named "just now" to solve the problem. Now, let us know how to avoid the same detours in the development process.
Background method: 1 protected string csharpvoid (string strcc)
2 {
3 strcc = "Hello! "+ Strcc;
4 return strcc;
5}
Foreground JS1 function Init ()
2 {
3 var v = "China ";
4 var S = '<% = csharpvoid ("' + V + '") %> ';
5 alert (s );
6}
In this case, OK.