aspdotnet-suresh offers articles and tutorials,csharp dot net, articles and tutorials,VB.NET Articles,Gridview articles,code examples of 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies


Here I will explain how to solve the problem
Microsoft JScript runtime error: Sys.Net.WebServiceFailedException: The server method 'GetSlides' failed with the following error: during use of Ajax Slideshow extender control to display images from root folder using


In previous post I explained clearly how to show slideshow using AjaxSlideshowExtender control from root folder in check here . During working with Ajax SlideshowExtender I got error like
Microsoft JScript runtime error: Sys.Net.WebServiceFailedException: The server method 'GetSlides' failed with the following error: <html><head>
 To solve this problem I check my code and I found my mistake that problem is because of I forgot to declare the WebMethod and ScriptMethod
We need to write webmethods in below format only and use exact parameters that should be same as whatever I mentioned in web method
public AjaxControlToolkit.Slide[] GetSlides()
In this web method we have a chance to change GetSlides method name only but return type and parametername should match and don’t forgot to mention this WebMethod and ScriptMethod above our GetSlides method the exception occurred because of missing these webmethods declaration.
Sometimes this problem occurs because of below line missing in code also

By default this line is commented in webservice page we need to uncomment that line.
If we need to get the slideshow webservice method without errors our webservice page code looks like this 

/// <summary>
/// Summary description for Slideshow
/// </summary>
[WebService(Namespace = "")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.

public class Slideshow : System.Web.Services.WebService {

public Slideshow () {

//Uncomment the following line if using designed components

public AjaxControlToolkit.Slide[] GetSlides()
string[] imagenames = System.IO.Directory.GetFiles(Server.MapPath("~/Images"));
AjaxControlToolkit.Slide[] photos = new AjaxControlToolkit.Slide[imagenames.Length];
for (int i = 0; i < imagenames.Length; i++)
string[] file = imagenames[i].Split('\\');
photos[i] = new AjaxControlToolkit.Slide("Images/" + file[file.Length - 1], file[file.Length - 1], "");
return photos;
I hope it helps to solve your problem.

Happy Coding……….

If you enjoyed this post, please support the blog below. It's FREE!

Get the latest,, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email


Anjum Rizwi said...

I have done as you suggested but still I am getting the error.

I am trying load the user control dynamically. User control has lot of complex code Repeater inside repeater so many action button.

Suresh Manikandan said...

your codes helped more... thankyou

Anonymous said...

its still giving same error..
plz help me to solve it!

hermes said...

The error problem still exist.

home said...

I can not find the differences.

Mourya said...
This comment has been removed by the author.
Mourya said...

i had the same issue, i was calling a webservice method from javascript and got the error

Sys.Net.WebServiceFailedException: The server method '' failed with the following error:

it can be solved by adding following lines to web.config


Give your Valuable Comments

Other Related Posts

© 2010-2012 All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.