Webservice only called once

3 posts, 0 answers
  1. Shawn
    Shawn avatar
    14 posts
    Member since:
    Jun 2014

    Posted 10 Oct 2014 Link to this post

    I need to create a rotator that dynamically adds and removes items, because the items will be changing in real time. I was trying to get the web service to work, and it does work the first time, but it never gets called a second time. Here is my code:

    [code language="csharp"]
    [System.Web.Script.Services.ScriptService]
    public class OverstockService : System.Web.Services.WebService 
    {
        [WebMethod]
    public RadRotatorItemData[] RSGetImages(int itemIndex, string argument)
    {
    List<RadRotatorItemData> result = new List<RadRotatorItemData>();
    RadRotatorItemData item; 
    for (int i = 0; i < 3; i++)
    {
    item = new RadRotatorItemData();
    item.Html = "test "+(itemIndex+i) + "arg=" + argument;
    result.Add(item);
    }
    return result.ToArray();
    }
    }
    [/code]

    [code language="html"]
    <script type="text/javascript">
    var index = 0;
    function OnClientItemsRequesting(sender, args) {
    var dbg = document.getElementById("debug");
    dbg.innerHTML += "Request<br/>";
    args.set_argument(index.toString());
    index++;
    }

    </script>
    <span id="debug"></span>
    <telerik:RadRotator ID="rrGallery" runat="server" Width="250px" Height="250px" ScrollDuration="500" 
    ItemHeight="200" ItemWidth="200" OnClientItemsRequesting="OnClientItemsRequesting" RotatorType="AutomaticAdvance">
    <WebServiceSettings Path="/WebServices/OverstockService.asmx" Method="RSGetImages" />
    </telerik:RadRotator>

    [/code]

    My plan was to remove items from the list once it got to a certain size, but the web service only gets called once. Can anyone help please?


  2. Shawn
    Shawn avatar
    14 posts
    Member since:
    Jun 2014

    Posted 10 Oct 2014 in reply to Shawn Link to this post

    Also, how do you post code to this forum? Can't find that info anywhere.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Shawn
    Shawn avatar
    14 posts
    Member since:
    Jun 2014

    Posted 13 Oct 2014 Link to this post

    Ok, I figured it out. I had to set WrapFrames="false".
Back to Top