SlideShowExtender problem

Last post 07-05-2009 4:04 PM by TATWORTH. 8 replies.

Sort Posts:

  • SlideShowExtender problem

    07-02-2009, 3:25 PM
    • Participant
      1,016 point Participant
    • eric2820
    • Member since 05-11-2009, 6:22 PM
    • Falls Church, VA
    • Posts 313

     I have a SlideShowExtender inside an UpdatePanel that also contains an image control for the SlideShowExtender to make use of.

    I'm trying to use a web service to serve up the images from a SQL Server database.

    The web service returns an AjaxControlToolkit.Slide[] but when I test the web service I get a similar but not the same type back.

    Insde the AjaxControlToolkit.Slide[] are entries containing the following for the image:

    string.Format( "operate=gemsFamily.ash?id={0}&seq={1}&full=1", id, i ); // which came from another post that I was giving once.

    The page should be loading with a single entry in the Slide[] containing:

    "operate=gemsFamily.ash?id=0&seq=1&full=1"

    I have no idea of what the "operate=" part of the url string is supposed to do. There is no code in the SlideShowBehavior.js file that parses "operate="!

     

    The SlideShowExtender has been configured as follows:

    ssMain.TargetControlID = "imgMain";
    ssMain.SlideShowServicePath = "http://localhost:1497/my-msi.net/services/gemsFamilyImages.asmx";
    ssMain.SlideShowServiceMethod = "LoadImageGroup" ;
    ssMain.ContextKey = "{'id' : 0L, 'seqStart' : 1L, 'seqEnd' : 1L}";
    ssMain.UseContextKey = true;

    The web service takes three long parameters.

    When I debug the web page using this, I do not get any errors or warnings until I hit the next button. Then I get this less then useful messge:

    So what could I possibly be doing incorrectly?

    Also, since the next and prev buttons are outside the UpdatePanel, do I need to add them to the UpdatePanel's Triggers collection, or is simply adding them to the SlideShowExtender sufficient?

     Finally, I found this at the bottom of the page source file (view source in the brower):

     <script type="text/javascript">
    //<![CDATA[
    Sys.Application.initialize();
    Sys.Application.add_init(function() {
        $create(AjaxControlToolkit.SlideShowBehavior, {"contextKey":"{\u0027values\u0027 : \u00270,1,1\u0027}","id":"ctl00_ContentPlaceHolder1_ssMain","imageDescriptionLabelID":"ctl00_ContentPlaceHolder1_lblDesc","imageTitleLabelID":"ctl00_ContentPlaceHolder1_lblTitle","nextButtonID":"ctl00_ContentPlaceHolder1_lbtnNext","previousButtonID":"ctl00_ContentPlaceHolder1_lbtnPrev","slideShowServiceMethod":"LoadImageGroup","slideShowServicePath":"http://localhost:1497/my-msi.net/services/gemsFamilyImages.asmx","useContextKey":true}, null, null, $get("ctl00_ContentPlaceHolder1_imgMain"));
    });
    //]]>
    </script>

    Please tell me that this gets regenerated on every page request, becuse if it doesn't than the SlideShowExtender is not going to work the way I expected it to work!

     Okay, I verified that this string seems to be regnerated in every postback, but I also see a potential problem:

    <script type="text/javascript">
    //<![CDATA[
    Sys.Application.initialize();
    Sys.Application.add_init(function() {
        $create(AjaxControlToolkit.SlideShowBehavior, {"id":"ctl00_ContentPlaceHolder1_ssMain","imageDescriptionLabelID":"ctl00_ContentPlaceHolder1_lblDesc","imageTitleLabelID":"ctl00_ContentPlaceHolder1_lblTitle","nextButtonID":"btnNext","previousButtonID":"btnPrev",
    "slideShowServiceMethod":"LoadImagegroup(0,1,1)","slideShowServicePath":"http://www.my-msi.net/Services/gemsFamilyImages.asmx"}, null, null, $get("ctl00_ContentPlaceHolder1_imgMain"));
    });
    //]]>
    </script>

    The problem area is:

    slideShowServiceMethod":"LoadImagegroup(0,1,1)

    What is going on here, I expected the web service method to be called with a single string parameter, not three integer parameters!

    No place in the code is the slideShowServeiceMethod being set with any parameters at all, and yet it used as the web service method, so it must be generated from the previous page, plus the url for the web service seems to have changed unexpectedly! Where in the heck is that new SlideShowService path coming from????

     

  • Re: SlideShowExtender problem

    07-03-2009, 10:04 AM
    • Participant
      1,016 point Participant
    • eric2820
    • Member since 05-11-2009, 6:22 PM
    • Falls Church, VA
    • Posts 313

    Ok guys, and gals... How did I get to over 1,000 points on these support forums? Primarily by looking for messages that nobody else would answer! Like the message above! I can't believe that nobody has used the AjaxControlToolkit.SlideShowExtender with a web service serving up the images. I'm not asking for anybody's solution above, just some pointers on how to get my solution working!

    The web service is now back to using three long parameters, and the ContextKey property is set as:
    ssMain.ContextKey = "{'id' : 0L, 'seqStart' : 1L, 'seqEnd' : 1L}";

    This appears to be working as I only get that non-desciptive error message occasionaly now, and not every time on the same element!

    I'm still not seeing any images displayed though. I'm begining to think that the problem is coming from:

    "operate=gemsFamily.ash?id=0&seq=1&full=1"

    Like I said above, there doesn't seem to be anything in the .js file for the SlideShowExtender that knows what to do with 'operate=' but this could be a feature built into javascript for all I know! If you know something about this, how about sharing a little knowlege.

     

  • Re: SlideShowExtender problem

    07-04-2009, 9:09 AM
    • All-Star
      61,577 point All-Star
    • TATWORTH
    • Member since 02-04-2003, 8:34 AM
    • England
    • Posts 12,091
    • TrustedFriends-MVPs

    >Primarily by looking for messages that nobody else would answer! Like the message above!

    Welcome to the club! I do much the same.

    Now to solving your problem. The approach  I would take is set up the smallest sample ilustrating the problem.

    Get a copy of Fiddler from http://www.fiddlertool.com/fiddler/version.asp and examine the http traffic.


    Don't forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
  • Re: SlideShowExtender problem

    07-04-2009, 10:39 AM
    • Participant
      1,016 point Participant
    • eric2820
    • Member since 05-11-2009, 6:22 PM
    • Falls Church, VA
    • Posts 313

     Well, I tried to download the Fiddler 2.0 application, but it doen't appear to be working on their server, because the download failed twice before I gave up on it.

    As for the smallest sample ilustrating the problem, what I'm trying to do is the simplest thing, and I think that I've reported all of the necessary information for someone to be able to provide a bit of assistance to me.

    By goal is simply to get the AjaxControlToolkit.SlideShowExtender to work with images stored in a SQL Server database. There was one old thread that I though would have pointed me in the correct direction, but alas, it didn't quite get me to where I wanted to be.

    I have an .ashx file the will serve up the images to an asp:Image control just fine. Of course it does that by writing the image directly to the Response stream, which is a problem when trying to use Ajax.

    The arrangement of the control on the page is:

                <asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="False" EnableViewState="False"
                    UpdateMode="Conditional">
                    <ContentTemplate>
                        <cc1:SlideShowExtender ID="ssMain" runat="server" NextButtonID="lbtnNext" PreviousButtonID="lbtnPrev"
                          ImageDescriptionLabelID="lblDesc" ImageTitleLabelID="lblTitle" TargetControlID="imgMain" >
                        </cc1:SlideShowExtender>
                        <asp:Label ID="lblTitle" runat="server"></asp:Label><br />
                        <asp:Image ImageUrl="" ID="imgMain" runat="server" Width="450" BorderStyle="Outset" BorderWidth="2" /><br />
                        <asp:Label ID="lblDesc" runat="server"></asp:Label>
                    </ContentTemplate>
                    <Triggers>
                      <asp:AsyncPostBackTrigger ControlID="lbtnNext" EventName="Click" />
                      <asp:AsyncPostBackTrigger ControlID="lbtnPrev" EventName="Click" />
                    </Triggers>
                  </asp:UpdatePanel> 

    Of course with this setup, the next and prev buttons don't even seem to be called as a breakpoint set within the next button's event handler is never hit! This may be normal for the SlideShowExtender, but I'd really like someone else to confirm that!

    That old thread mention the the correct way to use an .ashx file with the SlideShowExtender was to put "operate=" in front of the .ashx file name, thus I have:

    string url = string.Format( "operate=gemsFamily.ash?id={0}&seq={1}&full=1", id, i ); Where id is a web service parameter and i runs from seqStart to seqEnd which are also parameters to the web service that serves up the Image[].

    Of course I can't find any reference to "operate=" within the .js file for the SlideShowExtender, nor does it show up when I do a google search for javascript + operate. So I have very little faith that this old thread was providing the correct solution! I'm wishing that this forum had a search function for finding relevant information in older threads.

     The SlideShowExtender is configured as thus:

          ssMain.ImageDescriptionLabelID = "lblDesc";
          ssMain.ImageTitleLabelID = "lblTitle";
          ssMain.NextButtonID = "lbtnNext";
          ssMain.PreviousButtonID = "lbtnPrev";
          ssMain.TargetControlID = "imgMain";
          ssMain.SlideShowServicePath = "http://localhost:1497/my-msi.net/services/gemsFamilyImages.asmx";
          ssMain.SlideShowServiceMethod = "LoadImageGroup";
          ssMain.ContextKey = "{'id' : 0L, 'seqStart' : 1L, 'seqEnd' : 1L}";
          ssMain.UseContextKey = true;

    When I test the web service it works as expected, so the problem is not with the web service. If the web service is being called, the breakpoints I have within it are not being hit. Even if it is being called async. I expected my breakpoints to be hit, so my thinking is that the web service is not even being called, and I'm at my wits end trying to figure this out!


     

  • Re: SlideShowExtender problem

    07-04-2009, 11:26 AM
    • All-Star
      61,577 point All-Star
    • TATWORTH
    • Member since 02-04-2003, 8:34 AM
    • England
    • Posts 12,091
    • TrustedFriends-MVPs

    eric2820:
     Well, I tried to download the Fiddler 2.0 application, but it doen't appear to be working on their server, because the download failed twice before I gave up on it.

    I have just downloaded Fiddler2 to my PC (however I did have to restart it).

    Have you checked the issue log at http://ajaxcontroltoolkit.codeplex.com/ ?

    Don't forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
  • Re: SlideShowExtender problem

    07-05-2009, 12:54 PM
    • Participant
      1,016 point Participant
    • eric2820
    • Member since 05-11-2009, 6:22 PM
    • Falls Church, VA
    • Posts 313

     

    TATWORTH:

    eric2820:
     Well, I tried to download the Fiddler 2.0 application, but it doen't appear to be working on their server, because the download failed twice before I gave up on it.

    I have just downloaded Fiddler2 to my PC (however I did have to restart it).

    Have you checked the issue log at http://ajaxcontroltoolkit.codeplex.com/ ?

    I just checked the issue log, and all I was able to discover is that someone is doing exactly what I'm trying to do and having more success! Of course that was back in 2007 and there is no way that I could find to contact the auther of a post there!

    P.S. I just went back to the Fiddler site and was able to download Fiddler this time. Don't know what went wrong last time, but don't really care either now that it's working again :-)

     

  • Re: SlideShowExtender problem

    07-05-2009, 2:23 PM
    • All-Star
      61,577 point All-Star
    • TATWORTH
    • Member since 02-04-2003, 8:34 AM
    • England
    • Posts 12,091
    • TrustedFriends-MVPs

    >Of course that was back in 2007 and there is no way that I could find to contact the auther of a post there!

    Please post the URL of the thread you found. Even though it is  an old post, it would still be worth posting a link to this thread.

    Did you try the People tab on that project on CodePlex?

    Don't forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
  • Re: SlideShowExtender problem

    07-05-2009, 2:49 PM
    • Participant
      1,016 point Participant
    • eric2820
    • Member since 05-11-2009, 6:22 PM
    • Falls Church, VA
    • Posts 313

    Here is the url for the post: http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=12316

    I was just able to register with that site, and now have the opportunity to contact that poster.

    BTW, Twiddler has been less than helpful because the next button is not sending anything back to the server, so Twiddler has nothing to show for the ajax postback!

     You can see this for yourself at: http://www.my-msi.net/gemsFamily

     

  • Re: SlideShowExtender problem

    07-05-2009, 4:04 PM
    Answer
    • All-Star
      61,577 point All-Star
    • TATWORTH
    • Member since 02-04-2003, 8:34 AM
    • England
    • Posts 12,091
    • TrustedFriends-MVPs

    >I was just able to register with that site, and now have the opportunity to contact that poster.

    I have posted several projects on CodePlex and I would have been very surprised if you had not been able to contact its members.

    Don't forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
Page 1 of 1 (9 items)