Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

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

Share To

Development

© 2024 shulou.com SLNews company. All rights reserved.

12
Report