kdunnett
asked on
asp:panel and adding text
Hey all,
Is there a way of programmically adding strait text to an asp:panel from server side via c#?
For instance, to mimic this:
<asp:Panel ID="pnlTemp" Visible="False" Runat="server">
ADD THIS TEXT RIGHT HERE
</asp:Panel>
pseudo code:
(from a datagrid)
Panel temp = (Panel) e.Item.FindControl("pnlTem p");
temp.<some attribrute to add text to a panel>.text = "ADD THIS TEXT RIGHT HERE";
Is there a way of programmically adding strait text to an asp:panel from server side via c#?
For instance, to mimic this:
<asp:Panel ID="pnlTemp" Visible="False" Runat="server">
ADD THIS TEXT RIGHT HERE
</asp:Panel>
pseudo code:
(from a datagrid)
Panel temp = (Panel) e.Item.FindControl("pnlTem
temp.<some attribrute to add text to a panel>.text = "ADD THIS TEXT RIGHT HERE";
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I've always just drag-n-dropped a empty literal control in the gui designer. I'm too lazy to create controls via code. ;-)
ASKER
dbaduck,
That worked perfectly... Thanks for your help.
That worked perfectly... Thanks for your help.
LiteralControl lcTemp = pnlTemp.Controls[0] as LiteralControl;
lcTemp.Text = "ADD THIS TEXT RIGHT HERE";