这现在真的很令人沮丧。
我在 gridview 标记上有这个隐藏字段:
<asp:TemplateField>
<ItemTemplate>
<asp:HiddenField ID="dhide" Value='<%# Eval("shipDates","{0:M/dd/yyyy}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
然后在代码隐藏中,我试图检索 dhide 的值:
Sub cancelIt_Click(ByVal sender As Object, ByVal e As System.EventArgs) Dim objConnection As SqlConnection
Dim DLdates As HiddenField = DirectCast(GridView1.FindControl("dhide"), HiddenField)
Response.write (DLdates)
我究竟做错了什么?