0

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?

2
  • how the data store look like, any sample will be great Commented Sep 8, 2017 at 6:19
  • Not sure the datastore design is relevant here, rather how to get a string to render out as CSS Commented Sep 8, 2017 at 6:45

1 Answer 1

1

@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>
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.