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????