Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the problems of calling each other between C # code and function

Shulou Source: shulou.com Published: 2022-06-02 08:38:51 10月01日 Update

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= "#" >

Tags: Functions clips code methods problems background foreground variables content learning buttons scripts pages caches events that is ideas situations controls text Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Shulou Tech Info Huawei OPPO Reno Shulou Information