Hello,
I've got a RadButton with a custom icon working, but I want to use an image from my App_Themes/Blue/Images folder.
I can hardcode the Url like this:
But I want to do something like this:
However I get an exception saying:
Parser Error Message: Databinding expressions are only supported on objects that have a DataBinding event. Telerik.Web.UI.RadButtonIcon does not have a DataBinding event.
Can this be done? Is there a better way?
Thanks in advance,
Matt
I've got a RadButton with a custom icon working, but I want to use an image from my App_Themes/Blue/Images folder.
I can hardcode the Url like this:
<telerik:RadButton ID="btnLogin" runat="server" Text="Login" OnClick="btnLogin_Click"> <Icon PrimaryIconUrl="App_Themes/Blue/Images/ButtonImage.gif" PrimaryIconLeft="5" PrimaryIconTop="5" /> </telerik:RadButton>But I want to do something like this:
<telerik:RadButton ID="btnLogin" runat="server" Text="Login" OnClick="btnLogin_Click"> <Icon PrimaryIconUrl='<%# GetThemedUrl("Images/ButtonImage.gif")%>' PrimaryIconLeft="5" PrimaryIconTop="5" /></telerik:RadButton>protected string GetThemedUrl(string path){ string url = "~/App_Themes/" + this.Theme + "/" + path; return url;}
However I get an exception saying:
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.Parser Error Message: Databinding expressions are only supported on objects that have a DataBinding event. Telerik.Web.UI.RadButtonIcon does not have a DataBinding event.
Can this be done? Is there a better way?
Thanks in advance,
Matt