Load on Demand - Missing value for parameter

4 posts, 0 answers
  1. Steven
    Steven avatar
    2 posts
    Member since:
    Dec 2011

    Posted 22 Dec 2011 Link to this post

    In this project we have a rotator that should load items as needed, so we created a web service to do just that. In your example, you use a WCF web-service. After trying that unsuccessfully we switched over and tried creating an asmx web service. We are getting the following error:

    RadRotator items request failed:
    Exception = Invalid web service call, missing value for parameter: 'index'.

    Any assistance in getting past this would be great! 

    Here is the code for the rotator:

    <telerik:RadRotator ID="ItemRotator" runat="server" Width="100%" Height="500px" CssClass="horizontalRotator"
        ScrollDuration="500" FrameDuration="1" ItemHeight="200" ItemWidth="230" RotatorType="ButtonsOver"
        WrapFrames="false"  >
          <WebServiceSettings Path="~/Services/Assessment.asmx" Method="LoadAssessmentItemThumbnails"/>

    And the web service:

    using System;
    using System.Collections.Generic;
    using System.Web.Services;
    using Telerik.Web.UI;
    using Thinkgate.Base.Classes;
    namespace Thinkgate.Services
        /// <summary>
        /// Summary description for Assessment1
        /// </summary>
        [WebService(Namespace = "http://tempuri.org/")]
        [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 Assessment1 : System.Web.Services.WebService
            public RadRotatorItemData[] LoadAssessmentItemThumbnails(int index = 0, string argument = "")
                List<RadRotatorItemData> result = new List<RadRotatorItemData>();
                List<AssessmentItem> itemList = AssessmentItem.GetIncrementedAssessmentItemsByGradeSubjectCourse("01", "Mathematics", "Mathematics", index, index + 10);
                foreach (AssessmentItem item in itemList)
                    var rotatorItemData = new RadRotatorItemData();
                    rotatorItemData.Html = @"<div style='position: relative; background-color: green'>"
                                         + @"<input style='position: absolute; top: 0px' type='checkbox'/>"
                                         + @"<img style='position: absolute; top: 0px; left: 30px;' "
                                         + @"src='/Thumbnails/thumb_item_" + item.ID + ".png' "
                                         + @"alt='Item Thumbnail' onerror='onImgError(this);' onLoad='setDefaultImage(this);' /></div>";
                return result.ToArray();

    If we need to switch back to an svc web service please help us to set this up in the web.config as that was also an issue. 

    In addition, can the html be loaded into rad docks on item data bound?

    Thanks in advance,
  2. Steven
    Steven avatar
    2 posts
    Member since:
    Dec 2011

    Posted 22 Dec 2011 Link to this post

    Solved it. It wasn't an AJAX enabled web service. :)
  3. DevCraft R3 2016 release webinar banner
  4. Johnny Smith
    Johnny Smith avatar
    3 posts
    Member since:
    Jun 2009

    Posted 10 May 2012 Link to this post

    Looking at your code it looks like your web service was already AJAX enabled.  I have the same problem.  What precisely did you do?
  5. Slav
    Slav avatar
    1351 posts

    Posted 15 May 2012 Link to this post

    Hello Johnny,

    The parameters of the web service method should be named as shown in the online demo Rotator / Load On Demand in order to implement the load on demand functionality. In your case it appears that you have used index instead of itemIndex and the passed parameter is not recognized.

    To resolve the issue, please use the following signature for the web service method:
    public RadRotatorItemData[] LoadAssessmentItemThumbnails(int itemIndex, string argument)

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top