Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Rotator > Load on Demand - Missing value for parameter

Not answered Load on Demand - Missing value for parameter

Feed from this thread
  • Steven avatar

    Posted on Dec 22, 2011 (permalink)

    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"/>
    </telerik:RadRotator>

    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)]
        [System.ComponentModel.ToolboxItem(false)]
        // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
        [System.Web.Script.Services.ScriptService]
        public class Assessment1 : System.Web.Services.WebService
        {
            [WebMethod(true)]
            [System.Web.Script.Services.ScriptMethod]
            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>";
     
                    result.Add(rotatorItemData);
                }
     
                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,
    Steven
    Attached files

    Reply

  • Steven avatar

    Posted on Dec 22, 2011 (permalink)

    Solved it. It wasn't an AJAX enabled web service. :)

    Reply

  • Johnny Smith avatar

    Posted on May 10, 2012 (permalink)

    @Steven
    Looking at your code it looks like your web service was already AJAX enabled.  I have the same problem.  What precisely did you do?
    Thanks
    -Johnny

    Reply

  • Slav Slav admin's avatar

    Posted on May 15, 2012 (permalink)

    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)
    {
    ...
    }

    Regards,
    Slav
    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.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Rotator > Load on Demand - Missing value for parameter
Related resources for "Load on Demand - Missing value for parameter"

[  ASP.NET Rotator Features  |  Documentation  |  Demos |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial  ]