Fixed 2 bugs and added 2 small features on the CasdMladez website

Today, since I finally felt the urge and the resolve to show my “CasdMladez” website to the young people and the pastor, I checked whether everything on it works. I had known about the bug where AjaxFileUpload did not upload anything for a long time, but I had never gotten around to solving it. While looking into it, I found a second broken thing – deleting photos from a youth member’s profile! So I started by fixing the photo upload. I found out that when I load the page UploadPhotos.aspx?aid=1, the value 1 gets stored in a hidden input.

That value is then read from the hidden input so that the AJAX C# method knows which folder and which album in the DB to save the photo to. And that was the problem: AjaxFileUpload loaded the page in the background without the aid=1 parameter, so the method being executed did not know which album to save it to. In the end I solved it through the database: the user opens the UploadPhotos.aspx page with a specific aid, which is saved to the DB, and then the AJAX C# method mentioned above looks up the album id in the DB and works with it.

The downside is that if a user opens album 1, then album 2, and then uploads photos on the page of album 1, the photos will go to album 2. But there is a notice about this flaw on every upload page that uses this control, so hopefully people will understand and act accordingly. As for deleting photos from a youth member’s profile – as far as I remember, it was a bug in the C# handler. And the 2 new small features? If you load 👻 The domain has switched off its wifi for good. you can see 2 new items there:

  • Total number of photo views (excluding albums) (which as of today is already over 26000 (!) – that is great considering I have not promoted the website anywhere)
  • Total number of +1s on photos only – it shows 0, but that is because nobody has registered on my website yet, and only logged-in users can give a +1 on my website.
Categories

Leave a Reply