Summary of some methods of C# backend calling the front desk of other people in the company;
Method 1:
Suppose there are the following functions in the JS script tag of the foreground page:
<script> function A() { alert("hello word!"); } </script>
Then the background code on this page can be used to call the A() function in the C# background in this way;
First drag and drop an ItlResult control id=itlResult in the foreground;
Then call it like this in the c# background code:
="<script language='javascript'>A();</script>";
The above method applies to the background code that is the background layer of the foreground page;
Method 2:
Still assume that the front desk has an A() function:
Background call:
(this,typeof(UpdatePanel),"","A();",true);
This method is also suitable for the background code even if it is the c# code layer of the front-end page;
Method 3:
The background code calls A(), assuming that the A() function is a function in a certain JS code file.
string lstrScript = "<script language='javascript'>();</script>"; (lstScript); ();
This method can call other functions in the loaded JS.
Summarize
The above is the entire content of this article. I hope that the content of this article has certain reference value for your study or work. Thank you for your support. If you want to know more about it, please see the following links