Last post Sep 02, 2008 09:36 AM by Rippo
Aug 30, 2008 08:28 AM|NateC47|LINK
I think this is probably a very simple question, if you know what you're doing, of course, which in this case, unfortunately I don't...
I'm trying to write a function in ASP.NET that will display an image if it exists, checking 5 different filenames with the filename being pulled from a db.
I will warn you, I'm a Classic ASP programmer that is trying (slowly but surely) to upskill to .NET, so things may be a bit all over the place.
This is what I have come up with, but, it doesn't work...probably for reasons that will be obvious to you when you look at it.
Thanks in advance,
Aug 30, 2008 11:03 AM|SGWellens|LINK
Your closing tags are incorrect (you need the slash):
<img src='NoImage.jpg' />
Aug 30, 2008 11:31 AM|NateC47|LINK
I've fixed that, but that's not the main problem unfortunately.
It's erroring out on line 6. I've used Container.DataItem("ID"), but can this be used within a (or this) function?
Container.DataItem is being using to pull other value from the database successfully in another part of the script.
Sep 02, 2008 09:06 AM|DkUltra|LINK
A person could declare an
<asp:Image id="Image1" runat="server"
In the page load event
If not ispostback then
Image1.ImageUrl = "Your path"
Sep 02, 2008 09:36 AM|Rippo|LINK
Can you post a bit more of the code (basically the whole method (function)) so we can see what you are trying to do in a better context?