2009-10-30 436 views
0

我設法讓一個PNG覆蓋顯示在一個asp:超鏈接圖像上,但現在這意味着超鏈接是不可點擊的,有沒有辦法解決這個問題?PNG覆蓋使asp超鏈接不可點擊

<div class="ProductItem"> 
     <div class="picture"> 
      <asp:HyperLink ID="hlImageLink" runat="server" /> 
      <div class="overlay"></div> 
     </div> 
</div> 

    .HomePageProductGrid .ProductItem 
{ 
    text-align: center; 
    margin: 10px 10px 10px 10px; 
    width: 310px; 
    height: 410px; 
    background-repeat:no-repeat; 
    position:relative; 
} 

.HomePageProductGrid .ProductItem .picture 
{ 
    text-align: center; 
    position:relative; 
    padding-top:43px; 
} 

.HomePageProductGrid .overlay 
{ 
    background: url(images/frame1.png) no-repeat; 
    overflow: hidden; 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 310px; 
    height: 410px; 
} 

回答

0

感謝回答。超鏈接是從數據庫中獲取圖像,我想覆蓋頂部的相框。我使用css和絕對定位來定位png圖像,但只要png圖像在最上面,我就失去了鏈接。我現在已經改變了代碼周圍這樣的:

<div class="ProductItem"> 

      <div class="picture"> 
       <asp:Image ID="imgProduct" runat="server" /> 

       <asp:HyperLink ID="testHyperlink" CssClass="pictureLink" runat="server" > 
       <asp:Panel ID="productPanel" runat="server" ></asp:Panel> 

       </asp:HyperLink> 

      </div> 
     </div> 

圖像控制,現在是直接從數據庫中的圖像,我已經纏面板控制的超鏈接控制。面板控制從4個幀中選擇一個隨機圖像幀圖像。數據庫圖像的URL被提供給超鏈接控件。

現在,當您加載頁面時,每個產品都有一個隨機框架,並且鏈接會將您帶到相關產品頁面。

0

我不知道「asp:hyperLink」是如何工作的,但是您是否試過給它一個大於覆蓋層的z-index?該鏈接可能需要位置:相對於它的工作。

2

我不entirly知道它是什麼,你正在嘗試才達到,如果你要的是你可以點擊你一樣可以使用這個鏈接的圖像:

<asp:HyperLink ID="HyperLink1" runat="server" ImageUrl="~/Images/MyPic.png" NavigateUrl="~/MyPage.aspx">HyperLink</asp:HyperLink>

0

裹的一切,包括在asp您的覆蓋:超級鏈接

<div class="ProductItem"> 

    <asp:HyperLink ID="testHyperlink" CssClass="pictureLink" runat="server" > 
     <div class="picture"> 
      <asp:Image ID="imgProduct" runat="server" /> 
      <asp:Panel ID="productPanel" runat="server" ></asp:Panel> 
     </div> 
    </asp:HyperLink> 

</div> 

你必須改變你的CSS有點繞,但應該與覆蓋解決您的問題。