1. execute functions in C # code in javaScript Functions: Method 1: 1. Create a button to write the called or processed content to button_click in the background; 2. Write a js function at the front end with the content of document. getElementByIdx (& quot; btn1 & quot ;). click (); 3. At the front end or...
1. Execute functions in C # code in javaScript Functions:
Method 1: 1. Create a button to write the called or processed content to button_click in the background;
2. Write a js function on the front-end with the content document. getElementByIdx ("btn1"). click ();
3. Call js functions on the frontend or backend to stimulate the click event, which is equivalent to accessing the c # function in the background;
Method 2: 1. function declaration is public
Background code (change public to protected)
Public string ss ()
{
Return ("");
}
2. You can call <% = fucntion () %> in html.
Foreground script