如何从gridview中检索图像 [英] How to retrieve image from gridview

查看:78
本文介绍了如何从gridview中检索图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我拿一个gridview并绑定它。它也有图像。

它正确绑定。 Gridview还有链接kbutton。单击链接按钮,它将获取所选行的值并将其分配给文本框。我还想将现在在gridview中的图像分配给图像框。文本框正确分配值但不是图像。

任何人都可以帮助我。如何从gridview获取图像。

谢谢



这是我的代码

Hello everyone,I take one gridview and bind it.It has image also.
It bind properly. Gridview also has link kbutton. On click of link button it takes the selected rows value and assign it to textboxes. I also want to assign image which is now in gridview to image box. The textbox assigned value properly but not image.
Can anyone help me. How to get image from gridview.
Thank you

Here is my code

<asp:Image ID="ImgModel" runat="server" BorderColor="Black" BorderWidth="2"
                               style="height:120px;border-width:1px;" />




if (e.CommandName.Equals("selectRecord"))
           {
               MultiView1.SetActiveView(ViewAdd);
               GridViewRow row = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
               tbxModelCodeAdd.Text = row.Cells[1].Text;
               ddlJobType.SelectedItem.Text = row.Cells[2].Text;
               ImgModel.ImageUrl =("../images/")+row.Cells[3].Text;
               lblHidden.Text = id.ToString();


           }

推荐答案

试试此链接 - >

http:// csharp- video-tutorials.blogspot.in/2013/03/displaying-images-in-aspnet-gridview.html [ ^ ]







或此链接 - >>>



http://csharp-video-tutorials.blogspot.in/2013/03/displaying-images-in-aspnet -gridview_20.html [ ^ ]





你必须使用其中任何一个
try this link ->
http://csharp-video-tutorials.blogspot.in/2013/03/displaying-images-in-aspnet-gridview.html[^]



or this link ->>>

http://csharp-video-tutorials.blogspot.in/2013/03/displaying-images-in-aspnet-gridview_20.html[^]


You have to use either of them


使用图像字段控制.text框不起作用
Use Image Field control .text box will not work


这篇关于如何从gridview中检索图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆