基本上我有两个文件:
details.html
details.cs
我想details.cs
用来写入值,details.html
但 html 文本框仍然保持不变。
详细信息.html
<%@ Page Language="C#"
AutoEventWireup="true"
CodeBehind="details.cs"
Inherits="Details.DetailsHTML" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form>
<input id="txt_details" type="text" name="txt_details" runat="server"/>
</form>
</body>
</html>
详细信息.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.IO;
using System.Text;
using System.Data;
namespace Details
{
public partial class DetailsHTML : Page
{
//Declare controls used
protected System.Web.UI.HtmlControls.HtmlInputText txt_details;
protected void Page_Load(object sender, EventArgs e)
{
string strValue = Page.Request.Form ["txt_details"].ToString();
strValue = "test";
}
}
}