Jacek
Jacek

Reputation: 12053

Border of asp:panel

What I make wrong in this snippet of code?? I would like to have border around two divs, but I see line (rectangle with no content). Have you any idea? This code is inside my WebControl.

<asp:Panel ID="pan" runat="server" BorderStyle="solid" BorderWidth="1px" >
    <div style="width:18%; float:left;">
        <asp:Image id="img" runat="server" AlternateText="X" ImageUrl=""/>
    </div>

    <div style="width:78%; float:left;">
        <b><asp:Label ID="lblTitle" runat="server"></asp:Label></b>
        <br />
        <br />
        <asp:Label ID="lblDescription" runat="server"></asp:Label>
        <br />
        <asp:Button id="btnSet" runat="server" Text="Ustaw>"/>
        <br />
        <br />
        <asp:Label id="lblYouHaveCreditText" runat="server" Text="Masz kredytu na usługę"></asp:Label>
    </div>
</asp:Panel>

Upvotes: 2

Views: 23317

Answers (2)

To get border for the panel, do the following :

  • drag and drop panel on asp webform
  • go to properties in grouping text and type the group name
  • in border style select your choice.

Screenshot

Upvotes: 0

IrishChieftain
IrishChieftain

Reputation: 15253

Try the following:

<panel style="border: 1px solid #000; width: 500px; height:500px;" 
    id="pan" runat="server">

</div>

Heres' the jsFiddle of it: http://jsfiddle.net/C5jqS/

When you're done, lose the inline CSS ;-)

Upvotes: 4

Related Questions