0

I'm trying to print all photos in a list using a repeater and I got error that a tag is not well formed

I tried different ways and it still gives me an error

 <img  runat="server" src='http://p rod:82/en/Colleges/Gallary/<% ((SPListItem)Container.DataItem)["Name"] %>' />


  <img  runat="server" src="http://p rod:82/en/Colleges/Gallary/<% ((SPListItem)Container.DataItem)["Name"] %>" />

The name bring back the value picName.jpg

1
  • The URL doesn't seem correct http://p rod Commented Mar 20, 2018 at 5:38

1 Answer 1

0

Try the following instead:

<img runat="server" src='<%# string.Concat("http://prod:82/en/Colleges/Gallary/", Convert.ToString(((SPListItem)Container.DataItem)["Name"])) %>' />
1
  • Thank you, I tried this one too it worked! <%#"prod:82/…>
    – N.M
    Commented Mar 20, 2018 at 5:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.