Click here to Skip to main content
15,921,548 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello everybody.

I would like to use Ajax SlideShowExtender in my Masterpage, but I got into a trouble.
When I run my page, it shows below error messgae:

"
Microsoft JScript runtime error: Sys.Net.WebServiceFailedException: The server method 'GetSlides' failed with the following error: 
"

And i wanna add this point that when i use my code in another page, it works fine.

any idea?
Posted

this is my code in MasterPage.Master

XML
<asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:Image ID="Image1" runat="server" ImageUrl="~/images/Image1.jpg" />
        <ajaxToolkit:SlideShowExtender ID="Image1_SlideShowExtender"

        runat="server"
        Enabled="True"
        SlideShowServicePath=""
        TargetControlID="Image1"
        SlideShowServiceMethod="GetSlides"
        AutoPlay="true"
        Loop="true"
        NextButtonID="Button3"
        PlayButtonID="Button2"
        PlayButtonText="Play"
        PreviousButtonID="Button1"
        StopButtonText="Stop"
        ContextKey="imgSlide"
         UseContextKey="True">
        </ajaxToolkit:SlideShowExtender>

     <div style="text-align:center">
<asp:Button ID="Button1" Text="<<<" runat="server" />
<asp:Button ID="Button2" runat="server" />
<asp:Button ID="Button3" Text=">>>" runat="server" />


and this below is code behind in MasterPage.Master.cs:

C#
[System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]
    public static AjaxControlToolkit.Slide[] GetSlides(string contextKey)
    {
        AjaxControlToolkit.Slide[] imgSlide = new AjaxControlToolkit.Slide[4];

        imgSlide[0] = new AjaxControlToolkit.Slide("images/Image1.jpg", "Autumn", "Autumn Leaves");
        imgSlide[1] = new AjaxControlToolkit.Slide("images/Image2.jpg", "Creek", "Creek");
        imgSlide[2] = new AjaxControlToolkit.Slide("images/Image3.jpg", "Landscape", "Landscape");
        imgSlide[3] = new AjaxControlToolkit.Slide("images/Image4.jpg", "Dock", "Dock");

        return (imgSlide);
    }


Could you help me where should I use Update Panel and Triggers to the Control Id of the IMage...?
 
Share this answer
 
please do you have a solving for this problem i am facing the same issue
 
Share this answer
 
Comments
CHill60 2-Jun-14 13:27pm    
If you have a question of your own to ask then use the "Ask a Question" link. Very few members are going to spot a question posted as a Solution to an old post but those that do see it are likely to downvote you.
Use Update Panel and Triggers to the Control Id of the IMage,It Will work
 
Share this answer
 
Comments
pampam110 20-Oct-11 3:38am    
Thank you.

Could you please Check my code, and tell me where should i use Update Panel & Triggers.

Thanks in advance.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900