JS call method with parameters in the background

Source: Internet
Author: User
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.

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.