<HTML>
<HEAD>
<title>单值数据绑定示例1</title>
<script language="C#" runat="server">
void Page_Load(Object sender, EventArgs e)
{
Page.DataBind();
}
string Message{
get {
return "单值的数据绑定";
}
}
int MessageCount{
get {
return Message.Length;
}
}
</script>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<P>
<asp:ListBox id="ListBox1" runat="server"></asp:ListBox>
<asp:TextBox id="TextBox1" runat="server" Text='<%# Message %>'>
</asp:TextBox></P>
<P>
<asp:Label id="Label1" runat="server" Text='<%# MessageCount %>'>
</asp:Label></P>
</form>
</body>
</HTML>
<HEAD>
<title>单值数据绑定示例1</title>
<script language="C#" runat="server">
void Page_Load(Object sender, EventArgs e)
{
Page.DataBind();
}
string Message{
get {
return "单值的数据绑定";
}
}
int MessageCount{
get {
return Message.Length;
}
}
</script>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<P>
<asp:ListBox id="ListBox1" runat="server"></asp:ListBox>
<asp:TextBox id="TextBox1" runat="server" Text='<%# Message %>'>
</asp:TextBox></P>
<P>
<asp:Label id="Label1" runat="server" Text='<%# MessageCount %>'>
</asp:Label></P>
</form>
</body>
</HTML>