weixin_45367495 2022-06-15 11:35 采纳率: 87%
浏览 46
已结题

一种简易的html数据提交到后台的方法,该如何修改代码呢?

E:/前端/Test.html

<!DOCTYPE html>
<head>
    <title>Test</title>
</head>
<body>
    <div id="id">
        用户名:<input name="username" type="text"/>
        密码:<input name="password" type="password"/>
        <button type="submit" onclick="Test()">提交</button>
    </div><!--修改为div-->

    <script>
        function Test(){
            

            $.ajax({
                url:url,
                type:type,
                data:data,
                dataType:dataType,
            })
        }
    </script>
</body>

E:/后端

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="后端.Test" %>

<!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>
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
        </div>
    </form>
</body>
</html>


后面的是建立在VS2022的项目文件夹下面的

img


如果本机的地址是192.168.0.x,要如何实现

  • 写回答

2条回答 默认 最新

查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 6月23日
  • 已采纳回答 6月15日
  • 创建了问题 6月15日