How do I pass values to the service?

10 posts, 0 answers
  1. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 20 Sep 2010 Link to this post

    I want to have a toggle button decide which rotator items get sent into the control...

    Now looking at the clientside functions I think I could do it manually by adding items, but since it's already got the service functionality built in I'd love to just leverage that...

    Steve
  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 23 Sep 2010 Link to this post

    Hi Steve,

    As I have already answered your support ticket, the only solution is to use a Session variable in order to pass additional values to the WebService's method. This solution, however, will not work if the RadRotator control is declared in the ItemTemplate of a databound control.

    Sincerely yours,
    Fiko
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 23 Sep 2010 Link to this post

    Hmmm, I don't seem to have any tickets that mention this :)

    Session won't work as the buttons are clientside and the Rotator is set to WebService binding.  There are other controls like the scheduler which allow me to PASS values into the service to use, but I dont see anything in the rotator that will let me attach clientside parameters to consume with the service.

    Therefore the only thing I can think of is to use a RadXmlHttpPanel, then manually populate the rotator (which is not only a pain, but adds an extra control when I'm trying to keep the page lean).
  5. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 28 Sep 2010 Link to this post

    Hi Steve,

    "Hmmm, I don't seem to have any tickets that mention this :)"
    I apologize, this was my mistake :).


    In reference to your question:
    Unfortunately, the requested client-side functionality does not exist and for the time being you can change the service only on the server. to do that, I recommend you to wrap the control and the buttons in an RadAjaxPanel (or use a RadAjaxManager in order to implement your scenario) and then change the RadRotator's WebService settings in the Button's Click server-side event. In this case you can assign a Session value and then use that value in the WebService method.

    I hope this helps.

    All the best,
    Fiko
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 28 Sep 2010 Link to this post

    Hmmm I need the type of clientside performance that msajax just cannot provide :/

    Okay, I guess I'll go about manually building the rotator items after a callback.  OR (what about this)...on click of the button add in a dummy clientside rotator item which will instruct the service to do X when it sees it in the collection.  Then perhaps on the serverside REMOVE that temporary item.

    Most of the telerik control which do webservice binding provide the ability to pass values back to the services...if it wont get Q3 2010, can I get it added to PITS please?
  7. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 01 Oct 2010 Link to this post

    Hi Steve,

    It is already added in our PITS and you can check it by following this link.

    Sincerely yours,
    Fiko
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 29 Nov 2010 Link to this post

    I see this in the latest internal build :)

    Thank you so much!
  9. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 03 Dec 2010 Link to this post

    Hello Steve,

    Yes the change is included in the latest internal build. You can pass parameters to the server using this approach:
    • Attach a handler to the OnClientItemsRequesting
    • Implement the handler as shown bellow:
      <script type="text/javascript">
          function OnClientItemsRequesting(oRotator, args)
          {
              args.set_argument("a string value");
          }
      </script>
    • Then get the value in the web service as shown bellow:
      [WebMethod]
      public RadRotatorItemData[] GetRotatorData(int itemIndex, string argument)
      {
          if (itemIndex >= maxItemsCount) return null;
          List<RadRotatorItemData> result = new List<RadRotatorItemData>();
       
          for (int i = itemIndex; i < itemIndex + itemCount; i++)
          {
              RadRotatorItemData item = new RadRotatorItemData();
              item.Html = this.GetRadioButtonList();
              result.Add(item);
          }
       
          return result.ToArray();
      }

      Please note that the name of the argument is important

    Regards,
    Fiko
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  10. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 03 Dec 2010 Link to this post

    Fantastic!

    SP1 wouldn't be coming IN december by any chance would it?
  11. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 09 Dec 2010 Link to this post

    Hi Steve,

    Yes, the Q3 2010 SP1 release is scheduled for the middle of this month.

    Greetings,
    Fiko
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017