Add CSS file in .Net Core App.

  • I am a bit confused as to how you would create your own CSS file and add it in the application folder as an asset for an html string to be styled. Just the simplistic approach would be great. I use jsreport as a utility on my .net core console app.

  • The easiest is just read css file with c# and its content in <style>...</style>

    Another option is to reference it with file:/// in HTML head. Just make sure jsreport is configured to reach your file system
    Configure(cfg =>cfg.AllowLocalFilesAccess())

    Another option is to call this
    Configure(cfg =>cfg.AllowLocalFilesAccess().BaseUrlAsWorkingDirectory())
    with proper HTML you can reference css/js that are in your project.

  • Okay Thanks a lot.

Log in to reply

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.