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配置到管理后台

相关推荐
说私域9 小时前
从渠道渗透到圈层渗透:开源链动2+1模式、AI智能名片与S2B2C商城小程序的协同创新路径研究
人工智能·小程序·开源
一匹电信狗1 天前
【Linux我做主】进程优先级
linux·运维·服务器·c++·ubuntu·小程序·unix
壹立科技1 天前
Java源码构建智能名片小程序
java·开发语言·小程序
shadouqi1 天前
问题1:uniapp在pages样式穿刺没有问题,在components组件中样式穿刺小程序不起效果
小程序·uni-app
2501_915909062 天前
iOS电池寿命与App能耗监测实战 构建完整性能监控系统
android·ios·小程序·https·uni-app·iphone·webview
一只开心鸭!2 天前
原生微信小程序实现语音转文字搜索---同声传译
微信小程序·小程序
weixin_lynhgworld2 天前
旧物回收小程序:科技赋能,让旧物回收焕发生机
科技·小程序
此心光明事上练2 天前
微信小程序组件发布为 npm 包的具体步骤
微信小程序·小程序·npm
Byte_Me3 天前
从东南亚出发:小程序容器技术如何助力 App 快速打入全球市场?
小程序
小白_ysf3 天前
uniapp开发微信小程序(新旧版本对比:授权手机号登录、授权头像和昵称)
微信小程序·小程序·uni-app