Dear Sir/Madam
I am facing the following problem:
I set some attributes on a rotator's item at server-side using
But i cannot get them at client side. I am using the following code at client-side:
Function GetAttributeValue works fine with other telerik objects (ie TreeNodes) and i Know (for debug) that the rotator_OnItemShow is call when it should be.
Internet Explorer 8 gives me this error report
Thank you for your time,
Thomas Sarmis.
I am facing the following problem:
I set some attributes on a rotator's item at server-side using
protected
void
ItemRotator_OnItemDataBound(
object
sender, RadRotatorEventArgs e) {
DataRowView drv = (e.Item.DataItem
as
DataRowView);
e.Item.Attributes.Add(
"dbID"
, drv[
"ID"
].ToString() );
e.Item.Attributes.Add(
"dbCaption"
, drv[
"Caption"
].ToString() );
}
But i cannot get them at client side. I am using the following code at client-side:
function
GetAttributeValue(anObject, strProperty) {
if
(anObject) {
var
attributes = anObject.get_attributes();
if
(attributes) {
return
attributes.getAttribute(strProperty);
}
else
alert(
"Object.get_attributes() == null"
);
}
else
alert(
"Invalid Object"
);
}
var
SelectedItemGUID
var
SelectedItemTitle
function
rotator_OnItemShow(sender, args) {
var
targetIndex = args.get_item().get_index();
SelectedItemGUID = GetAttributeValue(args.get_item() ,
"dbID"
);
SelectedItemTitle = GetAttributeValue(args.get_item(),
"dbCaption"
);
}
Function GetAttributeValue works fine with other telerik objects (ie TreeNodes) and i Know (for debug) that the rotator_OnItemShow is call when it should be.
Internet Explorer 8 gives me this error report
Message: Object doesn't support this property or method
Thank you for your time,
Thomas Sarmis.