[英]How to add a custom style sheet to a web application utilizing EWL?
I'm trying to use Enterprise Web Library to quickly bring up aa web app and I want to add a custom style sheet. 我正在尝试使用Enterprise Web Library快速启动一个Web应用程序,我想添加一个自定义样式表。 I'm not sure how I can reference the style sheet within the application.
我不确定如何在应用程序中引用样式表。
Assume your style sheet is located in the web app project at Styles/MyStyles.css
. 假设您的样式表位于Web应用程序项目的
Styles/MyStyles.css
。 In your Global.asax
class, override EwfApp.GetStyleSheets
like so: 在您的
Global.asax
类中,这样重写EwfApp.GetStyleSheets
:
protected override List<CssInfo> GetStyleSheets() {
return new List<CssInfo> { new Styles.MyStyles.Info() };
}
This code won't compile unless you've run UpdateDependentLogic after creating your CSS file. 除非您在创建CSS文件后运行UpdateDependentLogic ,否则不会编译此代码。 This is how the
Info
class gets created for your style sheet. 这是为样式表创建
Info
类的方式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.