Get the value between an ASP.net user controls tags
I am wanting to create a user control which I will use for Tooltips around my site. I am wanting to call the user control from any of my .aspx pages as follows:
<gp:ToolTip ID="ctrlToolTip" runat="server">SOME TEXT OR HTML FOR MY TOOLTIP</gp:ToolTip>
Does anyone know h开发者_JS百科ow I can get the string in between the <gp:tooltip>
tags from the user control?
Thanks in advance
You can try something like this:
foreach (LiteralControl ltrCtrl in ctrlTooltip.Controls.OfType<LiteralControl>())
{
string text = ltrCtrl.Text;
}
精彩评论