モジュールの中にImagesフォルダがあります。私はこのフォルダにweb.configを追加しました。ビューファイルでモジュール内の画像フォルダにアクセスできない
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appSettings>
<add key="webpages:Enabled" value="false" />
</appSettings>
<system.web>
<httpHandlers>
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers accessPolicy="Script,Read">
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>
、私はIMG SRC = .. /画像/ background.pngを使用してみました、そして完全なパスはこれに解決、 はlocalhost:4126/OrchardLocal /コンテンツ/商品/画像/ background.png 。
画像src、localhost:4126/OrchardLocal/ModuleName/Images/background.pngにこの絶対URLを使用しようとしましたが、それでも機能しませんでした。 404エラーが表示されます。
これを取得するにはどうすればよいですか?
ありがとうございました。
ありがとうございました。それはうまくいった。 – user471317