Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何从后面的代码中设置 OnRowDataBound 方法名称?
ASP代码:
OnRowDataBound = "gvResults_RowDataBound"
如何从后面的代码中设置它?
gvResults.Attributes["OnRowDataBound"] = "gvResults_RowDataBound";
不起作用。
您必须使用RowDataBoundGridView 中的事件处理程序:
RowDataBound
gvResults.RowDataBound += gvResults_RowDataBound;