Incorrect Photo ID in Announcements Table!

Topics: Developer Discussion, Help, Request
Apr 30, 2007 at 4:29 PM

I am getting a red "x" where the thumbnail picture should be.

Steps to error:

1. Logon to clubsite
2. click on the "news" link
3. click on "New Article"
4. Under the "photo" section, click "Existing Image"
5. Thumbnail shows up with the correct picture ID=3
If I right click and capture the properties the URL = http://localhost:4169/coffee_club/UserControls/imagefetch.ashx?size=1&imageid=3
6. Click on "Use Selection"
7. When the Edit.aspx page renders, the photo is missing and it shows the following URL:

It changed the ImageID to 26!!!

What the heck?

Can someone help me fix this?


Apr 30, 2007 at 6:46 PM
Edited Apr 30, 2007 at 6:47 PM
I think I am getting closer to the issue, but still need some expert help here guys:

Whatever procedure loads the Announcements table with the "Photo" id number is loading the wrong number into the table. For my test the Announcement table looks like this:

id item date title description staticURL photo albumid
22 2007-04-30 02:22:00 PM test <p>test</p> NULL 26 NULL

The "Photo" number should have been "3", the AlbumId for Photo 3 is 26. Somehow we have the albumid loading into the photo field in the Announcements table.

Any ideas on how to fix?
May 1, 2007 at 7:42 PM
Ok, Here was the problem:

In the Photos_Formpicker.ascx

Protected Sub existingChosen_Click(ByVal sender As Object, ByVal e As System.EventArgs)
'ImageId = CInt("0" & AlbumList2.SelectedValue)
- The commented line above was putting the AlbumID in the Announcement.Photo field
ImageId = CInt(selectedimage.Value)
- After I changed the line of code back to the original Club Kit Code, it worked properly.
End Sub

Can someone explain why they changed this? Just curious, because it doesn't work. :-)
May 5, 2007 at 1:01 PM
That was in this post on the ASP.NET forums.

Put in an issue of what line to change and I will go ahead and change it in the source code.