flyingfisch flyingfisch - 23 days ago 9x
ASP.NET (C#) Question

Embedding SVG in page

I would like to embed svg directly into my view so that the output looks something like this:

<svg> ... </svg>

With PHP I would do this like so:

<? include('image.svg'); ?>

I tried
but got an error. Is there a way to fix this or another method I can try?


Embed your SVG into a cshtml view file instead of a .svg file, then you should be able to use @Html.Partial to render it.

Your partial would then look like