Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 图像仅在初始加载ASP.MVC页面时显示_Html_Image_Model View Controller_Redirect_Layout - Fatal编程技术网

Html 图像仅在初始加载ASP.MVC页面时显示

Html 图像仅在初始加载ASP.MVC页面时显示,html,image,model-view-controller,redirect,layout,Html,Image,Model View Controller,Redirect,Layout,在_Layout.cshtml中,我有一个标题图像和两个链接图像,当光标悬停在它们上面时,它们会变成其他图像。最初加载页面时(例如//localhost:58055/),会显示图像。例如,当我重定向链接,使URL为//localhost:58055/Home/Index时,图像只显示一个小的“断开的图像”图标。为什么会这样?这里是我在_Layout.cshtml中指定标题图像的地方 <header> <div class="trippy-title"&g

在_Layout.cshtml中,我有一个标题图像和两个链接图像,当光标悬停在它们上面时,它们会变成其他图像。最初加载页面时(例如//localhost:58055/),会显示图像。例如,当我重定向链接,使URL为//localhost:58055/Home/Index时,图像只显示一个小的“断开的图像”图标。为什么会这样?这里是我在_Layout.cshtml中指定标题图像的地方

    <header>
        <div class="trippy-title">
            <img src="images/title_wider.jpg" width="100%" height="100%" repeat>
        </div>
    </header>

为了更好地理解ASP.net中的位置,我建议您阅读本文

作为一个简单的解决方案,您可以使用~/images/title\u wider.jpg,这适用于Razor 2+