Public Sub myDataGrid_ItemDataBound(sender As Object, e As DataGridItemEventArgs)
'只有类型为footer的时候进行执行 If(e.Item.ItemType = ListItemType.Item) Dim myHyperLink As HyperLink = new HyperLink() myHyperLink.Text = "添加内容" myHyperLink.NavigateURL = "URL地址" e.Item.Cells(1).Controls.Add(myHyperLink) End If
<HeaderStyle Wrap="False" CssClass="wdg_TitleTr"></HeaderStyle>
<ItemStyle Wrap="False" CssClass="wdg_ContentTr"></ItemStyle>
</asp:EditCommandColumn>private void EditCommand_Click(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
string sID=e.Item.Cells[0].Text;
string sTime=e.Item.Cells[1].Text;
string sOwner=e.Item.Cells[2].Text;
Response.Redirect("StockOwnerDetail.aspx?id="+sID+"&time="+sTime+"&owner="+sOwner);
}
Response.Redirect("index.aspx");
'只有类型为footer的时候进行执行
If(e.Item.ItemType = ListItemType.Item)
Dim myHyperLink As HyperLink = new HyperLink()
myHyperLink.Text = "添加内容"
myHyperLink.NavigateURL = "URL地址"
e.Item.Cells(1).Controls.Add(myHyperLink)
End If
End Sub
</script>