Kevin

Kevin

  • NA
  • 21
  • 8k

Behind code for bound asp:label

Jan 5 2012 2:10 AM
Hi, Pretty new to asp.

I have been looking at many samples  and have got as far as I can and now need real help;

My page contains an asp:Datalist and has two controls:-
<asp:Image ID="Image1" runat="server" ImageUrl = '<%# Eval("FilePath")%>' Width = "100px" Height = "100px" />
<asp:Label ID="Label1" Runat="Server" Text = '<%# Eval("FileName")%> />

If I omit the asp:Label, the page runs and I get the pictures. However the page will not run with the label.
I know there should be something in the code behind, I guess to bind the FileName data. But I am not sure what this should be and where I should put it.
Any help gratefully recieved. Thanks









 




 



Hi, Very new to asp.

I have a datalist which has an image control. This works when I run the aspx page.

When I add an asp:Label the page will not run.

I know I have to bind the info "FileName" in the code behind but I do not know what this should be and where it should be placed.

Any help gratefully received. Thanks.






  









 

Attachment: code.zip

Answers (19)