Call function from GridView source html
Posted
by Steven
on Stack Overflow
See other posts from Stack Overflow
or by Steven
Published on 2010-03-17T01:40:06Z
Indexed on
2010/03/17
1:41 UTC
Read the original article
Hit count: 368
Here's my GridView HTML:
<asp:GridView ID="gvPortfolioImages" runat="server" AutoGenerateColumns="False" DataSourceID="ldsPortfolioImages">
<Columns>
<asp:TemplateField HeaderText="Image" SortExpression="Filename">
<ItemTemplate>
<img src='<%# Portfolio.GetImageURL(Eval("Thumbnail").ToString()) %>' alt='<%# Eval("Thumbnail") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
I'm get the following error where I'm trying to call Portfolio.GetImageURL():
The name 'Portfolio' does not exist in the current context
I've seen functions called like this before, but it doesn't seem to be working for me. Can anyone tell me what the problem is?
© Stack Overflow or respective owner