What are the problems of calling each other between C # code and function
This article mainly explains "what are the problems of mutual call between C # code and function". The content of the explanation in this article is simple and clear, and it is easy to learn and understand. let's study and learn "what are the problems of mutual call between C # code and function"?
One of the problems of calling each other between C # code and # function
Q: how do I access the C # function in #?
A:
# execute the function in the C# code in the function:
Method 1. First, set up a button to write the called or processed content to button_click in the background.
2. Write a js function in the foreground with the content document.getElementById ("btn1"). Click ()
3. Call the js function in the foreground or background to fire the click event, which is equal to visiting the background c # function
Method 2: 1. The function is declared as public
Background code (you can also change public to protected)
Public string ss () {return ("a");}
2. You can call <% = fucntion ()% > in html
Foreground script
< script language=# > var a = "<% = ss ()% >"; alert (a); < / script >
Method 3: 1.
< script language= "#" >