所以对于ASP双向(双向)绑定,我们这样做......ASP.NET数据绑定双向的,双向的,从后面的代码
<asp:textbox id="txtField" runat="server"
text='<%# Bind("SomeField") %>'>
</asp:textbox>
SomeField位于用作文本框容器的DetailsView的DataSource。
我也可以(使用文本框的OnDataBinding事件)的代码隐藏做到这一点:
protected void SomeField_OnDataBinding(object sender, EventArgs e)
{
((TextBox)sender).Text = Eval("SomeField").ToString();
}
但是,EVAL是只读的...我怎样才能从代码中指定绑定(双向) -背后?
+1为“肮脏的黑客”,现在我觉得自己像个黑客:) – 2011-08-16 12:06:07