Hi!
I am looking for a way to add custom attributes to RadToolbarButton to be rendered in html
When I use following snippet
RadToolBarButton button =
new
RadToolBarButton();
button.Attributes[
"data-attr"
] =
"CustomText"
;
button.CssClass +=
"tipsylink"
;
I expect to see<
a
class
=
"tipsylnk ..."
data-attr
=
"CustomText"
...>
But unfortunately I can see onlywithout data-attr attribute.<
a
class
=
"tipsylnk rtbWrap"
...>
I do use jquery to read such attributes from web controls for my custom needs.
And that works for all standard asp.net controls but unfortunately
radtoolbar implementation is different - as I understand it stores
custom attributes in another place.
I know that it is possible to read such attributes on client side using
but actually I'd like to use standard jquery $('.tipsylnk'). selector
var
toolBar = $find(
"<%=RadToolBar1.ClientID %>"
);
var
button = toolBar.findItemByText(
"Button 1"
);
alert(button.get_attributes().getAttribute(
"DisplayName"
));
and process all items in the same way.
So is it possible to render custom attributes to html element attribute
for RadToolbarButtons?