teaser image

Feb 2, 2010 at 5:08 PM
Edited Feb 2, 2010 at 5:11 PM

Hey guys,

 

I'm having trouble accessing the teaserimages, likely a problem with the urls.  Thumbnail images i've stored in the Resources folder of my web app and the string that is loaded into the teaserimage attribute is something like:

 

teaserimage="http://localhost:1101/Resources/images/Flatpete/_thumbs/Cliff Path_129095178897500000_thumb.jpg"

for a particular element.

I have extracted the data from sqlserver using the advice from a previous post for using a webservice to supply the data and subsequently convert to xml.  The data is recognised fine without the teaser image attribute included, so it looks something like this:

 

 

        void webservice_GetPostcardsCompleted(object sender, GetPostcardsCompletedEventArgs e)
        {
            string host = Application.Current.Host.Source.AbsoluteUri;
            host = host.Remove(host.IndexOf("/ClientBin"));
            XElement _postcards = new XElement("data",
                from x in e.Result
                orderby x.post_minyear
                select new XElement("event",
                    new XAttribute("title", (x.post_name.Remove(x.post_name.Length - 19))),
                    new XAttribute("start", x.post_minyear.ToString()),
                    new XAttribute("end", x.post_maxyear.ToString()),
                    new XAttribute("teaserimage", (host + (x.post_thumbnail)))));
            theTimeLine.timeline.ResetEvents(XDocument.Parse(_postcards.ToString()));
                    
        }

 

        void webservice_GetPostcardsCompleted(object sender, GetPostcardsCompletedEventArgs e)

        {

            string host = Application.Current.Host.Source.AbsoluteUri;

            host = host.Remove(host.IndexOf("/ClientBin"));

            XElement _postcards = new XElement("data",

                from x in e.Result

                orderby x.post_minyear

                select new XElement("event",

                    new XAttribute("title", (x.post_name.Remove(x.post_name.Length - 19))),

                    new XAttribute("start", x.post_minyear.ToString()),

                    new XAttribute("end", x.post_maxyear.ToString()),

                    new XAttribute("teaserimage", (host + (x.post_thumbnail)))));

            theTimeLine.timeline.ResetEvents(XDocument.Parse(_postcards.ToString()));

        }

 

 

I have tried changing the teaser image to remove spaces and replace with %20 in case they were a problem.

 

Any suggestions for deriving from a local host?

 

Thanks

 

Pete

 

ps:

 

The error message is as follows:

 

Line: 453

Error: Sys.InvalidOperationException: ImageError error #4001 in control 'ctl00_mainBody_Xaml1': AG_E_NETWORK_ERROR

 

Feb 3, 2010 at 2:49 PM

Hi,

 

I managed to figure out this problem, it has quite alot to do with access restrictions and I solved it by making sure all the image data was within the ClientBin Directory structure.  Any uri then passed was accepted.  Naturally http://localhost:1101/Resources was not working,

http://localhost:1101/ClientBin/Resources links do work and even with the spaces in the url.

Just need to make sure uploading info to the database is sufficiently coded to make sure symbols like &,* etc. dont get put into the name of the image.