如何在数据绑定gridview中的超链接控件中添加rel =“example_group”等属性?
<asp:HyperLink ID="HyperLink3" runat="server">HyperLink</asp:HyperLink>
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
Dim myImage As HyperLink = CType(e.Row.FindControl("HyperLink3"), HyperLink)
myImage.Attributes.Add("rel", "example_group")
End Sub
没用。对所有人提前做出回应......
答案 0 :(得分:1)
If e.Row.RowType = DataControlRowType.DataRow Then ... End If
......失踪了。现在好了。