How to change the text in a panel
A tricky question is this one:
How can I change the text in an asp:Panel?
Let's assume, a panel like this is given in your ASPX-page:
<asp:Panel ID="thePanel" runat="server">Hi, this is some text</asp:Panel>
Usually, you would start searching for a .Text- or .InnerText-Property. But - and this is the sad news - no such property exists. You don't have the chance to change the panel's text.
Really?
No, of course you can change the text. See the inner text as a LiteralControl and it will work. In your CodeBehind, you'll have to write code like this:
[VB.NET]
Dim objPanelText As LiteralControl = _
CType(thePanel.Controls.Item(0), LiteralControl)
objPanelText.Text = "Welcome to my VB.NET-page!"
[C#]
LiteralControl objPanelText = thePanel.Controls[0] as LiteralControl;
objPanelText.Text = "Welcome to my C#-page!";
That's it. Really simple, isn't it?