Ram wrote:
Quote:
Hi All,
I am working with an asp.net application. My client wants the
tooltiptext for the controls to be displayed from an xml file. Creating
an Xml file is not a problem.
How can I proceed further to retrieve the values from the Xml file
and assign them to the tooltiptext property of the web controls ?
Please give me a solution to accomplish this task with minimum code.
Thanks in advance.
Regards,
S.Ramalingam |
You can set the ID of each control and map those to the tooltips in
your xml file.
eg:
<tooltips>
<tooltip elementID="Button1">Tooltip for button one</tooltip>
....
....
</tooltips>
foreach(WebControl c in Page.Controls)
{
c.ToolTip=tooltipXmlDoc.SelectSingleNode("/tooltips/tooltip[@elementID='"+c.ID+"']").InnerText;
}
Note: The Page.Controls will only return the child controls of the
page.
-Dhanvanth