Sunday, March 11, 2012

AJAX Slide Show Problems...

Two things. The function that returns the photos must be a static function (shared for vb) and you need to enable pagemethods in the scriptmanager

<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"/>


i copied the ORIGINAL (working) slideshow asp.net code and script. I also added the enablepagemethods=true to my scriptmanager tag (on my master page)

and still got the same result...

Attached is the screen shot (from firefox) that i got. IE7 gives a similar message in a similar way, but tis even harder to read!

The error message

any ideas whats wrong?

for referece my code is this:

<asp:ScriptManagerID="ScriptManager1"runat="server"EnablePageMethods="true"></asp:ScriptManager><scriptrunat="Server"type="text/C#">

[System.Web.Services.

WebMethod]

[System.Web.Script.Services.

ScriptMethod]publicstatic AjaxControlToolkit.Slide[] GetSlides()

{

returnnew AjaxControlToolkit.Slide[] {new AjaxControlToolkit.Slide("images/Blue hills.jpg","Blue Hills","Go Blue"),new AjaxControlToolkit.Slide("images/Sunset.jpg","Sunset","Setting sun"),new AjaxControlToolkit.Slide("images/Winter.jpg","Winter","Wintery..."),new AjaxControlToolkit.Slide("images/Water lilies.jpg","Water lillies","Lillies in the water"),new AjaxControlToolkit.Slide("images/VerticalPicture.jpg","Sedona","Portrait style picture")};

}

</script>

<divstyle="text-align:center"><asp:ImageID="Image2"runat="server"Width="425"Style="border: 1px solid black;width:auto"ImageUrl="~/images/Blue hills.jpg"AlternateText="Blue Hills image"/><asp:Labelrunat="Server"ID="imageLabel1"/><br/><br/><asp:Buttonrunat="Server"ID="prevButton"Text="Prev"Font-Size="Larger"/><asp:Buttonrunat="Server"ID="playButton"Text="Play"Font-Size="Larger"/><asp:Buttonrunat="Server"ID="nextButton"Text="Next"Font-Size="Larger"/><ajaxToolkit:SlideShowExtenderID="slideshowextend1"runat="server"TargetControlID="Image1"SlideShowServiceMethod="GetSlides"AutoPlay="true"ImageDescriptionLabelID="imageLabel1"NextButtonID="nextButton"PlayButtonText="Play"StopButtonText="Stop"PreviousButtonID="prevButton"PlayButtonID="playButton"Loop="true"/></div>

pete

No comments:

Post a Comment