开发者

The images in the gridview will not rendered

i have a problem and hope that somebody can help me.

i am developing in vb.net. i have a gridview with a template field, in which i have a asp:image tag. But the browser dont show any image. i does not render the image. if i check the sourccode in the browser there is no image tag. But the visual web developer show the image. i tried all avriation of paths.

    <asp:TemplateField>
                         <ItemTemplat开发者_JAVA技巧e>
                             <asp:Image ID="Image1" runat="server" ImageUrl="~/ProfilePictures/icon.png" />
                          </ItemTemplate>
                      </asp:TemplateField>

Have any body an idea why this happens ?

Best regards


If the image tag isn't being rendered then that suggests that the visibility of this particular column may be set to false (or even the image itself).


Have you definitely bound data to the control you are using?

If not, then the Design view will display the image as it is giving you a preview of what the databound control will look like, but when running the website page, the control will not display anything if not bound.

edit 1 @user389431

Controlname.DataSource = yourdatasource
Controlname.Databind()

yourdatasource can be many things.

I just assumed you were binding data to the control as you are using the <asp:TemplateField>

Try putting the image outwith the TemplateField to see if it displays.

edit 2 @user389431

Ok, looks like you are binding the control ok, my next thing to check would be that getCont.GetAllMessagesFromThisForumId(ConversationID) actually has any values in it. So Debug the code, step through it, and check to see if it has values.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜