当前位置:编程学习 > C#/ASP.NET >>

用户控件拉入主页面就显视不了图片

我的问题是这样的,我的用户控件是放在二层目录下的,而主页放在一层目录,在二层目录下的用户控件能显视图片,而把这个用户控件拉入一层页面下,什么都能显视,就是图片不能显视出来,你们帮我看看,这是一个用户控件的html代码
    <style type="text/css">
<!--
#Layer1 {
position:absolute;
left:17px;
top:13px;
width:240;
height:236px;
z-index:1;
}
#Layer2 {
position:absolute;
left:369px;
top:61px;
width:2px;
height:50px;
z-index:2;
}
#Layer3 {
position:absolute;
left:260px;
top:26px;
width:426px;
height:82px;
z-index:2;
}
#Layer4 {
position:absolute;
left:690px;
top:59px;
width:295px;
height:87px;
z-index:3;
}
#Layer5 {
position:absolute;
left:260px;
top:111px;
width:712px;
height:90px;
z-index:3;
}
#Layer6 {
position:absolute;
left:269px;
top:172px;
width:700;
height:57px;
z-index:4;
}
#Layer7 {
position:absolute;
left:293px;
top:143px;
width:620px;
height:26px;
z-index:4;
}
.STYLE1 {font-size: xx-large}
#Layer8 {
position:absolute;
left:259px;
top:203px;
width:712px;
height:42px;
z-index:5;
background-color: #666666;
}
.STYLE3 {font-size: 18px}
-->
</style>

    <form id="form1" runat="server">
    <div id="Layer1" style="z-index: 101; left: 72px; width: 192px; top: 48px; height: 200px;">   
    <param name="wmode" value="transparent" />
    <embed src="网站资料/flash/my.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" style="width: 184px; height: 192px"></embed>
 
</div>
<div id="Layer3" style="z-index: 102; left: 256px; width: 496px; top: 72px">
    <img src="../网站资料/图库/biaoti/biaoti.jpg" style="width: 648px; height: 80px" /></div>
<div id="Layer5" style="z-index: 103; left: 256px; width: 496px; top: 160px; height: 72px">
    <img src="../网站资料/图库/biaoti/diaohang.png" style="width: 648px; height: 88px;" /></div>
<div id="Layer7" style="left: 272px; width: 624px; top: 192px; z-index: 104; height: 16px;">  <span class="STYLE8">
     首页  </span><span class="STYLE8">学院首页  </span><span class="STYLE4">信息平台  </span><span class="STYLE8"><span class="STYLE7">计算机系  </span><span class="STYLE4"> 教务处  </span><span class="STYLE8">电脑工作者协会  </span>论坛   关于我们</div> 
        <div style="z-index: 105; left: 904px; width: 152px; position: absolute; top: 40px;
            height: 168px">
            <asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="#999999"
                CellPadding="4" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
                ForeColor="Black" Height="1px" NextMonthText="下一月" PrevMonthText="上一月" Width="40px">
                <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
                <SelectorStyle BackColor="#CCCCCC" />
                <WeekendDayStyle BackColor="#FFFFCC" />
                <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
                <OtherMonthDayStyle ForeColor="Gray" />
                <NextPrevStyle VerticalAlign="Bottom" />
                <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
                <TitleStyle BackColor="#999999" BorderColor="Black" BorderStyle="Groove" Font-Bold="True" />
            </asp:Calendar>
        </div>
    </form>在页面下的代码是:<%@ Page Language="VB" AutoEventWireup="false" CodeFile="index.aspx.vb" Inherits="index"  %>
<%@ Register TagPrefix="Acme" TagName="head" Src="~/webcontrols/head.ascx"  %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
  
</head>
  
<body>
  <Acme:head ID="acme1" runat ="server" />
</body>
</html>
--------------------编程问答-------------------- 难道你改目录的时候没改相应的路径吗?用手机上的,不方便复制你的原文。
--------------------编程问答-------------------- asp.net是使用“~/”打头的地址来表示路径的,这个是服务器端表达路径,既不是什么html绝对路径也不是什么相对路径。如果你要直接计算输出到客户端的html路径,那么使用
this.ResolveUrl("~/路径")
这类方式来计算,不要写死什么绝对路径或者相对路径。 --------------------编程问答-------------------- 简单方法  看下产生HTML就知道了 。
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,