This project is read-only.

Picasa Web Album API Challenge

Dec 27, 2010 at 9:56 PM
Edited Dec 27, 2010 at 10:00 PM

Anyone up for a challenge?  I know that this isn't really a BE issue but for me it is as I am trying to implement in my family website.  I am trying to implement a Photo Gallery using code provided to my by Johan Carneskog.  This code uses the Google API to get your Picasa web albums and then display them.   When you click on the album it displays the photos within the album.  You can see the Albums in action at his site here.  Johan was gracious enough to give to me his pages/code that create his gallery and photo pages.  He did say that the coding was not his best work as he never planned on sharing it.

My problem is I cannot get the Photos page to load.  Instead I get a bunch of random special characters.  I have turned off customerrors in the web.config file to help in trouble shooting. 

You can see that the gallery does load here: but when you click on a album you get the junk.  e.g. - �`I�%&/m�{J�J��t��`$ؐ@���

The reason I am scratching my head is that it works for Johan but not for me and I didn't change any of his code.  You can download the files at my site by visiting the above link and then there is a link to the files in a .rar file.

I am at a total loss and I am not a skilled at C#.  Any assistance would be appreciated.

If nothing else...any thoughts on what I could look for?

Below is the CSS being used:


photo gallery*************/

   .gallery span{
        margin: 0 auto;
        font: 9px verdana;
    .gallery span b{
        font:bold 11px verdana;
        .gallery span strong{
        font:bold 11px verdana;
    .gallery img
{	border:1px solid #ccc;
    	/*border:1px solid #ccc;*/
        margin:0px 5px 5px 0px;
       /* background:url('pics/albumBg.jpg')*/
        padding:13px 13px 0px 13px;
    .gallery span{margin-top:10px;}


Dec 27, 2010 at 10:18 PM

That's good you turned off custom errors.  In your global.asax file, there's a Application_Error() function.

Try replacing your Application_Error with the one I posted here on Nov 9th.  You should then hopefully see an error message on the page, rather than the garbage characters.

Dec 28, 2010 at 4:10 AM
Edited Dec 28, 2010 at 4:12 AM

I have gotten more info listed below:


The remote server returned an error: (404) Not Found.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.WebException: The remote server returned an error: (404) Not Found.

Source Error:


Line 132:    {
Line 133:        PhotoQuery query = new PhotoQuery(PicasaQuery.CreatePicasaUri(username, GalleryId));
Line 134:        PicasaFeed feed = service.Query(query);
Line 135:        return feed.Entries.Count;
Line 136:    }

Source File: c:\Temp\blogengine_23271eda8b37\BlogEngine\BlogEngine.NET\photos.aspx.cs    Line: 134

Stack Trace:

[WebException: The remote server returned an error: (404) Not Found.]
   System.Net.HttpWebRequest.GetResponse() +5373789
   Google.GData.Client.GDataRequest.Execute() +77

[GDataRequestException: Execution of request failed:]
   Google.GData.Client.GDataRequest.Execute() +162
   Google.GData.Client.GDataGAuthRequest.Execute(Int32 retryCounter) +402
   Google.GData.Client.GDataGAuthRequest.Execute() +10
   Google.GData.Client.Service.Query(Uri queryUri, DateTime ifModifiedSince, Int64& contentLength) +152
   Google.GData.Client.Service.Query(FeedQuery feedQuery, DateTime ifModifiedSince) +150
   Google.GData.Client.Service.Query(FeedQuery feedQuery) +20
   Google.GData.Photos.PicasaService.Query(KindQuery feedQuery) +5
   photos.GetNumberOfOnlinePhotosInGallery(PicasaService service, String username, String GalleryId) in c:\Temp\blogengine_23271eda8b37\BlogEngine\BlogEngine.NET\photos.aspx.cs:134
   photos.Page_Load(Object sender, EventArgs e) in c:\Temp\blogengine_23271eda8b37\BlogEngine\BlogEngine.NET\photos.aspx.cs:53
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627



The line

should read

This path seems to get build by the google dll's but I am not 100% sure on that.  

Could it be that I am using a different version of the dll' as compared to Jonah and that is the cause for the error?



Dec 28, 2010 at 5:57 AM

It looks like this error is coming from photos.aspx.cs (a BE page/file).  I've not seen the code, so I'm not sure if the path is being built there, or in another BE specific file, or if it's being built directly in the Google DLLs.

If you have a link to this code, or could post some of the code here, we can take a look at it.

Dec 29, 2010 at 12:20 AM

As it turns out it was an issue with the dll I was using as compare to Jonah.  He sent me his dll and I put them in place and that solved the issue.


Thanks for your assistance Ben.



Sep 23, 2013 at 4:30 AM
Hi Guy, I am making a family website at this moment and plan to create the function of photo albums. Your photo albums look great and it is just what I want. If you can share your code for me, i will appreciate to use them to build up my photo albums.

Thanks from Betty