Tilde Slash Paths Not Working in MVC 4

前端 未结 8 485
逝去的感伤
逝去的感伤 2021-01-12 01:10

As I understand it, a plain ol\' \"~/foo\" path is supposed to work like @Url.Content(\"~/\") in MVC 4. However, I\'m trying to do this and getting many broken paths -- the

8条回答
  •  鱼传尺愫
    2021-01-12 02:00

    The issue is about href= and not which < tag >
    Examples:

    < img src="@Url.Content("Images/someImage.jpg")"/>
    < a href="@Url.Content("Home/About")" >click here< /a>
    

    Its ok to nest @ inside other @section {}

提交回复
热议问题