How to add a custom style sheet to a web application utilizing EWL?
-
05-07-2021 - |
Question
I'm trying to use Enterprise Web Library to quickly bring up a a web app and I want to add a custom style sheet. I'm not sure how I can reference the style sheet within the application.
Solution
Assume your style sheet is located in the web app project at Styles/MyStyles.css
. In your Global.asax
class, override EwfApp.GetStyleSheets
like so:
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. This is how the Info
class gets created for your style sheet.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow