asp.net开发中小程序端跟后端交互中的发现

小程序端wxml端代码示例:

复制代码
<button bind:tap="test">提交</button>

小程序端js代码示例:

复制代码
  test(){
     console.log('ok')
     wx.request({
       url: 'https://localhost:44375/lianxi01.aspx',
     })
  },

asp.net端代码示例:

复制代码
cs端代码示例:
{
    public partial class lianxi01 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        // // .aspx.cs
        public static int getvalue(int value)
        {
            return 555 * value;
        }
    }
}

html端代码:

复制代码
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="lianxi01.aspx.cs" Inherits="lianxi_jiaohu.lianxi01" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <!--.aspx-->
            <div><%=getvalue(2)%></div>
        </div>
    </form>
</body>
</html>

小程序端运行结果如下:

复制代码
在这里插入代码片

会出现一个在小程序管理后台端曾经配置过的域名数组。同时要求把现在的地址:https://localhost:44375/lianxi01.aspx配置到管理后台

相关推荐
吴声子夜歌19 小时前
小程序——组件一
小程序
object not found1 天前
微信小程序审核机制解析(2026 实践向总结)
微信小程序·小程序
吴声子夜歌1 天前
小程序——组件二
小程序
蓝黑20203 天前
从经纬度获取地理信息以及从地名获取经纬度
小程序
吴声子夜歌3 天前
小程序——逻辑层
小程序
花木偶3 天前
小迪网安:APP攻防-Day1
安全·小程序
吴声子夜歌4 天前
小程序——生命周期函数和事件处理函数
服务器·前端·小程序
hnxaoli4 天前
win10程序(十六)通达信参数清洗器
开发语言·python·小程序·股票·炒股
吴声子夜歌5 天前
小程序——项目结构
小程序
Lucky小黄人6 天前
微信小程序查看备案号
微信小程序·小程序