主页上的图像路径问题 [英] Image Path problem from master page

查看:71
本文介绍了主页上的图像路径问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在asp.net中创建一个网站,该网站在根级别具有一个母版页,在文件夹中具有一个子页.
例如,帮助台的根级别-MasterPage1.master
帮助台/学校(文件夹)/SchoolEntry.aspx页面
服务台/图片(文件夹)/header_image.jpeg

现在,母版页在图像"文件夹的标题上具有图像,现在当我为webform(child)选择母版页时,其图像不再显示.

主页的图像设置为
< img src ="Images/header_image.jpg"/>

它显示在母版页中,而不显示在School/SchoolEntry.aspx路径中的子页中.

请帮我怎么做?

问候,
Krunal Panchal

Hello everyone,

I am making a website in asp.net which has a master page at root level , and a child page in a folder.
E.g Helpdesk root level - MasterPage1.master
Helpdesk/School (folder)/SchoolEntry.aspx Page
Helpdesk/Images(folder)/header_image.jpeg

Now the master page has image on its header from Images folder, now when i select master page for the webform(child) its image is not shown.

Image for master page is set as
<img src="Images/header_image.jpg"/>

It is shown in master page but not in child page which is situated in School/SchoolEntry.aspx path.

Please help me how to do it??

Regards,
Krunal Panchal

推荐答案

可以尝试以下标记.在这里,我已使用符号〜
给出了路径
src =<%= Page.ResolveUrl("〜)%>/Images/header_image.jpg"
can you try with following tag.Here i have given the path using the symbol ~

src="<%= Page.ResolveUrl("~")%>/Images/header_image.jpg"


请参阅此技巧来避免此类问题:解析多文件夹网站中的路径 [
Have a look at this Tip to avoid such issues: Resolving Paths in a Multi-Folder WebSite[^]


亲爱的,

了解机制来破坏文件

    根(0)
  • 图片(1)
    • header_image.jpg(1.0)
Hi dear,

Understan the michanism to rout the file

    Root (0)
  • Images (1)
    • header_image.jpg (1.0)
  • 学校(1)
src="../Images/header_image.jpg"


我希望以上对u


I hope above is help full to u


这篇关于主页上的图像路径问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆