Max
Max

Reputation: 4869

ASP.NET MVC How to include css from database

I have HTML & CSS stored in different columns in a database row. I can use @Html.Raw(string) to render my HTML, but how can I include the css style?

Upvotes: 0

Views: 285

Answers (1)

Daniel Park
Daniel Park

Reputation: 4021

@Html.Raw(string s) simply renders the provided string as an IHtmlString in the view. All you need to do is provide it in a tag that can understand the rendered contents.

<style type="text/css>
    @Html.Raw(style)
</style>

Upvotes: 1

Related Questions