开发者

image + link as a field in asp.net gridview

开发者 https://www.devze.com 2023-03-01 04:37 出处:网络
I need a folder image with a link to the corresponding folder like, HyperLink fileLink = new HyperLink();

I need a folder image with a link to the corresponding folder like,

            HyperLink fileLink = new HyperLink();
            fileLink.ImageUrl = "/_l开发者_运维问答ayouts/images/OPENFOLD.GIF";
            fileLink.NavigateUrl = url_string;

The url string was constructed based on other column values in the same row. How to add this image + link field to each row of a grid view? I dont think a custom field is an option here...

Thanks in advance!


You should look at templating a gridview.

Using templates you can specify that a specific row contains an image with a hyperlink on it, binding the NavigateURL property to a specific value. This can occur for each row.

This is a good tutorial: http://msdn.microsoft.com/en-us/library/bb288031.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消