开发者

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;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜