flyingfisch flyingfisch - 1 year ago 192
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?

Answer Source

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


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download