search

Home  >  Q&A  >  body text

c# - Why can't images be displayed in asp mvc?

This is my first time doing mvc, so I don’t know a lot of things! ! ! !

The path I dragged into this picture is correct! ! !

But it just can’t be displayed:

Baidu said yes

<img src="@Url.Content("logo-gif.gif")" />

Written like this, but it still doesn’t show up! ! !
Please help me, thank you!

曾经蜡笔没有小新曾经蜡笔没有小新2795 days ago895

reply all(2)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-05-16 17:07:53

    The website cannot access the contents of the Views folder by default.
    But it can be changed.
    There is a web.config file under Views, and the following code in it prevents request processing in the Views folder

    <system.webServer>
        <handlers>
          <remove name="BlockViewHandler"/>
          <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
        </handlers>
      </system.webServer>

    reply
    0
  • 怪我咯

    怪我咯2017-05-16 17:07:53

    Oh. It’s been solved. It’s weird. Pictures can’t be placed under the sharepage folder. I just create a new folder. -_-||

    reply
    0
  • Cancelreply