简体   繁体   English

自定义Telerik Skin程序集未加载其样式

[英]Custom Telerik Skin assembly is not loading its styles

I followed these instructions: http://docs.telerik.com/devtools/aspnet-ajax/general-information/controlling-visual-appearance/how-to-load-skins-from-external-assemblies 我遵循了以下说明: http : //docs.telerik.com/devtools/aspnet-ajax/general-information/controlling-visual-appearance/how-to-load-skins-from-external-assemblies

Button.Test.css Button.Test.css

.RadButton_Test {
  background-color: red !important;
}

Button.css Button.css

<< empty file >> <<空文件>>

RadButton.cs RadButton.cs

[assembly: System.Web.UI.WebResource("Skins.Button.css", "text/css", PerformSubstitution = true)]
[assembly: System.Web.UI.WebResource("Skins.Test.Button.css", "text/css", PerformSubstitution = true)]
namespace Skins
{

  [Telerik.Web.EmbeddedSkin("Button", null, typeof(RadButton))] 
  [Telerik.Web.EmbeddedSkin("Button", "Test", typeof(RadButton))] 
  public class RadButton
  {
  }
}

web.config web.config

<add key="Telerik.Web.SkinsAssembly" value="Skins"/>

page.aspx page.aspx

<telerik:RadButton ID="btn" ButtonType="LinkButton" runat="server" Skin="Test" Text="GO" OnClick="btnClick"></telerik:RadButton>        

.

.

The buttons are not red. 这些按钮不是红色的。 The page renders fine but without the styles. 页面呈现良好,但没有样式。 When I change the skin="Test" to skin="TestXX" I get the error that there is no embedded skin TestXX, so they seem to be loaded properly. 当我将skin="Test"更改为skin="TestXX"我得到一个错误,即没有嵌入式皮肤TestXX,因此它们似乎已正确加载。 The button renders to have the class RadButton_Test . 该按钮将呈现为RadButton_Test类。

What do I miss? 我想念什么?

First, try the AssemblyBuilder: http://skinsassemblybuilder.telerik.com/ in case the issue is with the generation of the assembly. 首先,尝试AssemblyBuilder: http : //skinsassemblybuilder.telerik.com/ ,以防出现装配问题。

If this does not help, try the sample project form this thread: http://www.telerik.com/support/code-library/how-to-load-skins-from-external-assemblies . 如果这样做没有帮助,请尝试通过以下线程尝试示例项目: http : //www.telerik.com/support/code-library/how-to-load-skins-from-external-assemblies You can try renaming files and namespaces there after replacing them with your own files. 将文件和名称空间替换为自己的文件后,可以尝试在其中重命名文件和名称空间。

Generally, you should ensure all the webresources are fetched. 通常,您应确保已获取所有Web资源。 If there are 404 errors, there are two probable causes: 如果存在404错误,则可能有两个原因:

  • the stylesheets/sprites are not marked as Embedded Resource (that's their Build Action ) 样式表/精​​灵未标记为“ Embedded Resource (即其“ Build Action

  • paths and/or namespaces are incorrect. 路径和/或名称空间不正确。 Here is some of the code that registers built-in skins so you can use it as reference: http://pastebin.com/BJJbgngB (the C# syntax used breaks SO's markdown) 以下是一些注册内置皮肤的代码,因此您可以将其用作参考: http : //pastebin.com/BJJbgngB (使用的C#语法破坏了SO的减价)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将自定义AuthProvider与Telerik Reporting ServiceStack程序集或任何外部程序集一起使用 - Using custom AuthProvider with Telerik Reporting ServiceStack assembly or any external assembly 关于自定义telerik radEditor皮肤 - Regarding customizing telerik radEditor skin 在不加载其程序集的情况下获取引用类型的全名 - Get the full name of a referenced type without loading its assembly 延迟加载和Telerik报告? - Lazy loading and Telerik Reporting? 如何从自定义目录动态加载程序集,包括其依赖项? - How to dynamically load an assembly from custom directory including its dependencies? 获取自定义程序集属性而不加载到当前的AppDomain中 - Getting custom assembly attributes without loading into current AppDomain 将具有依赖项的程序集加载到其目录中位于加载应用程序目录之外的其他程序集中? - Loading an assembly with dependencies to other assemblies within its directory which is outside the loading applications directory? 从定制位置加载程序集,同时在编译时使用类型 - Loading assembly from custom location while using types at compile time .NET:加载资源时自定义程序集解析失败 - .NET: Custom assembly resolution failing when loading resources Telerik RadGrid上的自定义聚合 - Custom aggregate on Telerik RadGrid
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM