+1-888-365-2779
Try Now
More in this section

Forums / Designing & Styling / show a picture as background

show a picture as background

3 posts, 0 answered
  1. Sarah
    Sarah avatar
    8 posts
    Registered:
    16 Nov 2010
    23 Jun 2011
    Link to this post
    HI,
    I use the following code to show a picture as background in a usercontrol in master page. but I can't see the img background.

    Could you fix it for me?


    code:
    adbar1.ascx

    <%

     

    @ Control Language="C#" AutoEventWireup="true" CodeBehind="AdBar1.ascx.cs" Inherits="SitefinityWebApp.Control.AdBar1" %>

     

    <

     

     

    div style=" width:255px;height:289px;background-image:url('Image/Grey-Box-drop-shadow.png'); background-repeat:no-repeat;padding: 0px 0 0 0px;" align="left">

     

    <

     

     

    center>

     

    <

     

     

    table width="180" style="vertical-align:top;text-align:center;height:236px">

     

     

     

    <tr>

     

     

     

    <td>

     

     

     

    &nbsp;

     

     

     

    </td>

     

     

     

    </tr>

     

     

     

    <tr id="adImageTR" style="vertical-align:middle;height:86px" align="right">

     

     

     

    <td align="center">

     

     

     

    <asp:Image ID="Image1" runat="server" ImageUrl="~/Control/Image/question-mark.gif" />

     

     

     

    </td>

     

     

     

    </tr>

     

     

     

    <tr style="height: 140px;vertical-align:top;text-align:center">

     

     

     

    <td align="center">

     

     

     

    <table style="text-align:center" width="140px">

     

     

     

    <tr>

     

     

     

    <td style="width:140px;vertical-align:top;height:20px">

     

     

     

    <asp:Label ID="Label1" runat="server" Font-Size="14px" Font-Bold="True" Text="Customers" Font-Names="Verdana"></asp:Label>

     

     

     

    </td>

     

     

     

    </tr>

     

     

     

    <tr>

     

     

     

    <td>

     

     

     

    &nbsp;

     

     

     

    </td>

     

     

     

    </tr>

     

     

     

    <tr>

     

     

     

    <td style="width:140px;vertical-align:top;">

     

     

     

    <asp:Label ID="Label2" runat="server" Text="Access and" Font-Names="Verdana" Font-Size="11pt"></asp:Label>

     

     

     

    </td>

     

     

     

    </tr>

     

     

     

    </table>

     

     

     

    </td>

     

     

     

    </tr>

     

     

     

    <tr style="vertical-align:bottom;height:30px">

     

     

     

    <td align="center">

     

     

     

    <telerik:RadButton ID="RadButton1" runat="server" ButtonType="LinkButton" Text="More">

     

     

     

    </telerik:RadButton>

     

     

     

    </td>

     

     

     

    </tr>

     

    </

     

     

    table>

     

    </

     

     

    center>

     

    </

     

     

    div>

     


    test page:

    <%

     

    @ Page Title="" Language="C#" MasterPageFile="~/Sitefinity/WebsiteTemplete/ZintelHomeTemplete/App_Master/ZintelHome.Master" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="SitefinityWebApp.test" %>

     

    <%

     

    @ Register TagPrefix="uc3" TagName="AdBar1" Src="~/Control/AdBar1.ascx" %>

     

    <

     

     

    asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

     

    </

     

     

    asp:Content>

     

    <

     

     

    asp:Content ID="Content2" ContentPlaceHolderID="navigationContentPlaceHolder" runat="server">

     

    </

     

     

    asp:Content>

     

    <

     

     

    asp:Content ID="Content3" ContentPlaceHolderID="MenuContentPlaceHolder" runat="server">

     

    </

     

     

    asp:Content>

     

    <

     

     

    asp:Content ID="Content4" ContentPlaceHolderID="mainContentPlaceHolder" runat="server">

     

    <

     

     

    uc3:AdBar1 runat="server" ID="adbar11" titleStr="ddd" commentStr="ffff" linkButtonText="test"/>

     

    </

     

     

    asp:Content>

     

    <

     

     

    asp:Content ID="Content5" ContentPlaceHolderID="spaceContentPlaceHolder" runat="server">

     

    </

     

     

    asp:Content>

     

    <

     

     

    asp:Content ID="Content6" ContentPlaceHolderID="footerContentPlaceHolder" runat="server">

     

    </

     

     

    asp:Content>

     



    master page:

    <%

     

    @ Master Language="C#" AutoEventWireup="true" CodeBehind="ZintelHome.master.cs" Inherits="SitefinityWebApp.Sitefinity.WebsiteTemplete.ZintelHomeTemplete.App_Master.ZintelHome" %>

     

    <%

     

    @ Register TagPrefix="uc1" TagName="Header" Src="~/Control/HeaderBar.ascx" %>

     

    <%

     

    @ Register TagPrefix="uc2" TagName="noteBar" Src="~/Control/notationBar.ascx" %>

     

    <%

     

    @ Register TagPrefix="uc3" TagName="AdBaar1" Src="~/Control/AdBar1.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>

     

     

     

    <asp:ContentPlaceHolder ID="head" runat="server">

     

     

     

    </asp:ContentPlaceHolder>

     

    </

     

     

    head>

     

    <

     

     

    body>

     

     

     

    <form id="form1" runat="server">

     

     

     

    <telerik:RadScriptManager runat="server" ID="radScriptManager">

     

     

     

    </telerik:RadScriptManager>

     

     

     

    <telerik:RadSkinManager runat="server" ID="radSkinManager" Skin="Web20">

     

     

     

    </telerik:RadSkinManager>

     

     

     

    <telerik:RadFormDecorator ID="FormDecorator1" runat="server" DecoratedControls="Textbox"></telerik:RadFormDecorator>

     

     

     

    <table class="BaseLayout" cellpadding="0" cellspacing="0" width="1000px">

     

     

     

    <tr>

     

     

     

    <td>

     

     

     

    <uc1:Header ID="HeaderUC" runat="server" />

     

     

     

    </td>

     

     

     

    </tr>

     

     

     

    <tr>

     

     

     

    <td>

     

     

     

    <asp:ContentPlaceHolder ID="navigationContentPlaceHolder" runat="server">

     

     

     

    </asp:ContentPlaceHolder>

     

     

     

    </td>

     

     

     

    </tr>

     

     

     

    <tr>

     

     

     

    <td>

     

     

     

    <asp:ContentPlaceHolder ID="MenuContentPlaceHolder" runat="server">

     

     

     

    </asp:ContentPlaceHolder>

     

     

     

    </td>

     

     

     

    </tr>

     

     

     

    <tr>

     

     

     

    <td>

     

     

     

    <table>

     

     

     

    <tr align="center" style="text-align:center">

     

     

     

    <td style="width: 270px;">

     

     

     

    <asp:ContentPlaceHolder ID="ContentPlaceHolder0" runat="server">

     

     

     

    </asp:ContentPlaceHolder>

     

     

     

    </td>

     

     

     

    <td style="width: 250px">

     

     

     

    <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

     

     

     

    </asp:ContentPlaceHolder>

     

     

     

    </td>

     

     

     

    <td style="width: 250px">

     

     

     

    <asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server">

     

     

     

    </asp:ContentPlaceHolder>

     

     

     

    </td>

     

     

     

    <td style="width: 250px" align="right">

     

     

     

    <asp:ContentPlaceHolder ID="ContentPlaceHolder3" runat="server">

     

     

     

    </asp:ContentPlaceHolder>

     

     

     

    </td>

     

     

     

    </tr>

     

     

     

    </table>

     

     

     

    </td>

     

     

     

    </tr>

     

     

     

    <tr>

     

     

     

    <td>

     

     

     

    <asp:ContentPlaceHolder ID="mainContentPlaceHolder" runat="server">

     

     

     

    </asp:ContentPlaceHolder>

     

     

     

    </td>

     

     

     

    </tr>

     

     

     

    <tr>

     

     

     

    <td>

     

     

     

    <asp:ContentPlaceHolder ID="spaceContentPlaceHolder" runat="server">

     

     

     

    </asp:ContentPlaceHolder>

     

     

     

    </td>

     

     

     

    </tr>

     

     

     

    <tr>

     

     

     

    <td>

     

     

     

    <asp:ContentPlaceHolder ID="footerContentPlaceHolder" runat="server">

     

     

     

    </asp:ContentPlaceHolder>

     

     

     

    </td>

     

     

     

    </tr>

     

     

     

    </table>

     

     

     

    </form>

     

    </

     

     

    body>

     

    </

     

     

    html>

     


  2. Sarah
    Sarah avatar
    8 posts
    Registered:
    16 Nov 2010
    23 Jun 2011
    Link to this post
    attached image
  3. Jordan
    Jordan avatar
    172 posts
    Registered:
    20 Oct 2015
    24 Jun 2011
    Link to this post
    Hi Sarah,

    Probably the path of the image can not be resolved corectly. Please try with this one and let me know if it works:

    ~/Sitefinity/WebsiteTemplates/TemplateName/App_Themes/ThemeName/Images/Grey-Box-drop-shadow.png


    All the best,
    Jordan
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
3 posts, 0 answered