[英]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.