WebGrid.net 3.5 Column圖像鏈接的用法
1.設定ColumnType為HyperLink;
2.設定HyperLinkDisplayText為:<img border=0 src='images\detail.gif'>
3.如果要在新窗口中彈出,設定Hyperlinktarget為"_blank"
4.加入代碼:
2.設定HyperLinkDisplayText為:<img border=0 src='images\detail.gif'>
3.如果要在新窗口中彈出,設定Hyperlinktarget為"_blank"
4.加入代碼:
1private void WebGrid1_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)
2 {
3 if (e.Row.Type == RowType.Record)
4 {
5 WebGridCellCollection cells = e.Row.Cells;
6
7
8 cells.GetNamedItem("Detail").Value = "ProductDetail.aspx?ID=" + cells.GetNamedItem("編號").Text.Trim() ;
9 }
10
11 }
2 {
3 if (e.Row.Type == RowType.Record)
4 {
5 WebGridCellCollection cells = e.Row.Cells;
6
7
8 cells.GetNamedItem("Detail").Value = "ProductDetail.aspx?ID=" + cells.GetNamedItem("編號").Text.Trim() ;
9 }
10
11 }