The following code allows you to easilly loop thru all webpage controls and change their settings. For example change all ToolTips of the existing Textboxes:
Code into PageLoad:
Dim strToolTip = "HELP"
FindToolTipControl(Page.Controls, strToolTip) ' or: FindToolTipControl(mainTable.Controls, strToolTip) or whatever controcolection you would like to loop thru
The functions:
Private Sub FindToolTipControl(ByVal oControlCollection As ControlCollection, ByVal strToolTip As String)
For Each oControl As Control In oControlCollection
SetTooltip(oControl, strToolTip)
FindToolTipControl(oControl.Controls, strToolTip)
Next
End Sub
Private Sub SetTooltip(ByVal oControl As Control, ByVal strToolTip As String)
Select Case oControl.GetType.ToString
Case "System.Web.UI.WebControls.TextBox"
Dim otxt As TextBox = oControl.FindControl(oControl.ID)
otxt.ToolTip = strToolTip
Case "System.Web.UI.WebControls.RadioButton"
Dim otxt As RadioButton = oControl.FindControl(oControl.ID)
otxt.ToolTip = strToolTip
Case "System.Web.UI.WebControls.CheckBox"
Dim otxt As CheckBox = oControl.FindControl(oControl.ID)
otxt.ToolTip = strToolTip
Case "System.Web.UI.WebControls.FileUpload"
Dim otxt As FileUpload = oControl.FindControl(oControl.ID)
otxt.ToolTip = strToolTip
End Select
End Sub
You can apply this code to any page you want or, if you use a masterpage, just paste it in the codebehind of the masterpage!
(most settings to controls can also be set in skin-files or with css, but that takes to much time in my opinion)
Enjoy!