10000太远了,还是近点的用1000,或者100的
后端C#代码
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace Asp.NetDemo2 { public partial class DeWebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { this.txtNum1.Text = "请输入内容"; } protected void btnPass_Click(object sender, EventArgs e) { this.txtNum2.Text = this.txtNum1.Text; } } }
前端代码
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DeWebForm1.aspx.cs" Inherits="Asp.NetDemo2.DeWebForm1" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:TextBox ID="txtNum1" runat="server"></asp:TextBox> <br /> <asp:Button ID="btnPass" runat="server" Text="复制到第二个文本框" onclick="btnPass_Click" /> <br /> <asp:TextBox ID="txtNum2" runat="server"></asp:TextBox> </div> </form> </body> </html>
运行效果:
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。