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:
And the web service:
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
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