Saturday, March 24, 2012

Panel Text

When I make a panel in vs.net it shows text on the screen saying "Panel". How do I get rid of that text.double click to select the panel,highlight the text,press the delete key...
It shouldn't because there's no text property of a panel.


<asp:panel id="pnlDates" Runat="server">
<tr>
<td>From Date : <asp:textbox id="datefrom" runat="server" Width="103px"></asp:textbox></td>
<td>To Date : <asp:textbox id="dateto" runat="server" Width="103px"></asp:textbox></td>
</tr>
</asp:panel>

In my code


pnlDates.Visible = False

Whether it should or shouldn't be there is besides the point, when adding a panel to a webform from the toolbox, it puts the text "Panel" in the panel. Since there is no text property, the only way to remove it is to manually delete it as I stated above.
> It shouldn't because there's no text property of a panel.

You're right in that it doesn't have a Text property.

However, a Panel will allow text ... text will be added as a Literal control to the Panel's Controls collection. Apparently, VS.NET has done exactly that, to give the Panel control some visual representation in the Designer.

As BlindEddie says, the Delete key is all that is needed.
Oh, my bad.

I've always created panels manually. I just tried dragging a panel onto a page in the designer and it adds the word "Panel". That's got to be annoying.

I would think it's still easier to manually create a panel since you're in the HTML already you know exactly where the placement will go whether it be a certain table cell, table row, or entire table, etc.

I just created a 3 row table and tried to put a panel around a table row in the designer and couldn't get it to pinpoint a row. Down with design mode development!

0 comments:

Post a Comment