Public Class frmFMECA
Inherits System.Web.UI.Page
Public LastFailureDate As String
并在.aspx中使用它
<asp:TextBox ID="txtLastFailureDate_GR" Text="<%= this.LastFailureDate %>" runat="server"></asp:TextBox>
但它没有在文本框中显示除<%= this.LastFailureDate%>之外的任何内容。
您需要使用DataBinding表达式。
Text='<%# this.LastFailureDate %>'
如果TextBox不在GridView,Repeater等内,你需要在DataBind()
中手动调用Page_Load
protected void Page_Load(object sender, EventArgs e)
{
DataBind();
}