This is a migrated thread and some comments may be shown as answers.

GetWebResourceUrl and Office2010 skins

1 Answer 130 Views
Grid
This is a migrated thread and some comments may be shown as answers.
James Stuart
Top achievements
Rank 1
James Stuart asked on 16 Sep 2011, 11:18 PM
Has anybody been able to extract images from the new office 2010 themes as in the example below.

Many thanks
James
// Works
<img src='<%= Page.ClientScript.GetWebResourceUrl(grid.GetType(), "Telerik.Web.UI.Skins.Black.Grid.AddRecord.gif") %>' />
 
// Doesn't work
<img src='<%= Page.ClientScript.GetWebResourceUrl(grid.GetType(), "Telerik.Web.UI.Skins.Office2010Black.Grid.AddRecord.gif") %>' />


1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 22 Sep 2011, 08:12 AM
Hi James,

The difference between the Black and the Office2010Black Skin is that Black is embedded in the Telerik.Web.UI assembly where as the Office2010Black Skin is in the Telerik.Web.UI.Skins assembly. That is why you cannot get the resources for it the way you did. Though you can try the below approach:
<img src='<%# Telerik.Web.SkinRegistrar.GetWebResourceUrl(Page,typeof(RadGrid), "Telerik.Web.UI.Skins.Office2010Black.Grid.AddRecord.gif") %>' />

Note that if the image is outside bound control, you need to call DataBind() for the page.

Additionally, I suggest that you use this approach for getting resources for each of the Skins. Because since Q3 2011 all Skins will be moved to the Telerik.Web.UI.Skins assembly.

Kind regards,
Iana Tsolova
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Grid
Asked by
James Stuart
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or