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配置到管理后台
在这里插入图片描述

相关推荐

最近更新

  1. TCP协议是安全的吗?

    2024-03-29 07:24:03       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-03-29 07:24:03       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-03-29 07:24:03       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-03-29 07:24:03       20 阅读

热门阅读

  1. python-numpy-常用函数详解

    2024-03-29 07:24:03       17 阅读
  2. 久菜盒子|毕业设计|金融|DCC-GARCH模型

    2024-03-29 07:24:03       18 阅读
  3. OpenCV图像滤波、边缘检测

    2024-03-29 07:24:03       21 阅读
  4. Redis缓存数据库表(列单独缓存)

    2024-03-29 07:24:03       16 阅读
  5. Spring Boot整合Redis

    2024-03-29 07:24:03       17 阅读
  6. 《青少年成长管理2024》 006 “成长需要教育”

    2024-03-29 07:24:03       19 阅读
  7. MyBatis3源码深度解析(二十七)MyBatis整合Spring框架

    2024-03-29 07:24:03       22 阅读
  8. 设计模式的主要分类

    2024-03-29 07:24:03       18 阅读