EAPCtrlUtils Methods |
The EAPCtrlUtils type exposes the following members.
Name | Description | |
---|---|---|
AddEventHandler(WebControl, String, String, Boolean) |
Add a new javascript event handler (e.g. onclick) to a control without overwriting any existing handler.
| |
AddEventHandler(WebControl, String, String, Boolean, Boolean) |
Add a new javascript event handler (e.g. onclick) to a control without overwriting any existing handler.
| |
AddPaneF8Info(IAppContext, Page, IConsolePane) |
Add F8 debug info for the console pane.
| |
AddPaneF8Info(IAppContext, Page, IWizContainerPane) |
Add F8 debug info for the WizGrouper pane.
| |
ApplyClassAndStyle(HtmlControl, String, String) |
Set the CssClass and Style pairs on the control. Each is set only if that string is non-null/non-empty.
| |
ApplyClassAndStyle(WebControl, String, String) |
Set the CssClass and Style pairs on the control. Each is set only if that string is non-null/non-empty.
| |
ApplyF8Fixes |
For browsers other than IE many DOM element (e.g. DIV and TR) do not fire keyup events
unless set up in a specific manner to do so. This method performs that set up including
dealing with a number of oddities, some browser-specific.
| |
ApplyTagAttributes |
Apply arbitrary tag attributes (for example as specified in the field's TagAttributes property).
Note that this may step on attributes already on the control!
Example: [style="color:red" tabindex="-1"] (without the brackets).
| |
ClosestParent |
Finds the closest parent control that "is" the specified type and, if cssClass is specified,
has the specified CssClass.
| |
FindControlRecursive |
Recursively search the control hierarchy for the specified control and below for
a control with the specified ID and return that control, if found. If not found,
null is returned.
| |
GetAttribute |
Gets the specified Attribute for the control.
The control can be a WebControl or an HtmlControl.
| |
GetCssClass |
Gets the CssClass for the control.
The control can be a WebControl or an HtmlControl.
| |
GetDocType |
Returns the DOCTYPE string
| |
HasCssClass |
Determines whether or not the specified control has the specified CssClass.
Note that if cssClass is null/empty then true is always returned.
| |
HasVisibleControls |
Determines whether or not the control has any visible controls in its controls collection.
| |
HeightForcer |
Generates a literal control for use in a table to force a minimum row height.
Seems to work more reliably than min-height CSS and works in all browsers including IE6.
See HeightForcerHtml(Boolean, Int32) to get the HTML enbodied in the control.
| |
HeightForcerHtml |
Generates HTML for use in a table to force a minimum row height.
Seems to work more reliably than min-height CSS and works in all browsers including IE6.
See HeightForcer(Boolean, Int32) to get a control based on this HTML.
| |
LoadControl |
Load a user control.
Depending on the options provided this method may throw an error or simply return null if the control cannot be loaded.
| |
MergeCssClass(String, String) |
Merges two CSS class lists into a single list avoiding adding duplicates to any existing list.
The individual classes in each list should be separated by one or more spaces.
| |
MergeCssClass(Control, String) |
Add the specified CSS class name(s) to the control's CssClass list.
Note that the control can be a WebControl or an HtmlControl.
| |
MergeCssClass(HtmlControl, String) |
Add the specified CSS class name(s) to the control's CssClass list.
| |
MergeCssClass(WebControl, String) |
Add the specified CSS class name(s) to the control's CssClass list.
| |
MoveAttribute |
Move the specified attribute from the source control's Attributes collection do the destination control's Atributes collection.
The purpose of this is to allow derived composites to move attributes from the composite control to one of the contained controls.
| |
OnClickAppend(HtmlInputButton, String) |
Append the specified javascript to the button's onclick script, if any.
See also OnClickPrepend(HtmlInputButton, String).
| |
OnClickAppend(TextBox, String, String) |
Append the specified javascript to the textbox's onclick script, if any.
| |
OnClickPrepend |
Prepend the specified javascript to the button's onclick script, if any.
See also OnClickAppend(HtmlInputButton, String).
| |
PostInfoGet |
Retrieve the value of the named item from the eapPostInfo control in the page's form.
Values in that control are automatically logged to the devlog and xot_request_log
if/when the page is posted back. The most important use for this is for tracking which
PageElement within a wizard page is being posted back.
Use PostInfoSet(Page, String, String) to set a particular value.
| |
PostInfoSet |
Set a name/value item to the eapPostInfo control in the page's form.
If the control does not already exist in the form it will be added. If the named item
already exists in the control's value, the value will be updated, otherwise it will be added.
Values in that control are automatically logged to the devlog and xot_request_log
if/when the page is posted back. The most important use for this is for tracking which
PageElement within a wizard page is being posted back.
Use PostInfoGet(Page, String) to retrieve a particular value.
| |
ReaderToTable(DataTable) |
Reads a DataTable into an HTML table. The table will always include a header row.
The header row will have the "hdr" CSSClass.
| |
ReaderToTable(IDataReader) |
Reads a DataReader into an HTML table. The table will always include a header row.
The header row will have the "hdr" CSSClass.
| |
RemoveCssClass(HtmlControl, String) |
Remove the specified CSS class name from the control's class list.
| |
RemoveCssClass(WebControl, String) |
Remove the specified CSS class name from the control's CssClass list.
| |
RemovePositioningStyles |
Remove the CSS positioning styles from the specified control. This is generally used when
changing a control from absolute positioning when making it a child of a container control.
| |
RemoveStyle |
Remove the specified CSS style using both the enum and string identifiers. This methods
removes BOTH from the style because it seems that if you add a style by name and remove
it by enum the .Net does NOT remove the style!
| |
ReplaceAnchors |
HTML does not allow nested anchor tags. This code replaces any anchor opening and/or closing tags with corresponding SPAN tags.
| |
ReplaceWith |
Replace this control in its parent's Controls collection, with the specified replacement. If either control is null, no replacement is performed.
| |
ReverseControls |
Reverse the order of the controls in the collection.
Note that to do this the controls may be removed from the collection and readded.
| |
ScreenReaderIgnore |
Adds an empty alt tag to the control to indicate to screen readers that the control
(typically an image) should be ignored. Screen readers are used by some visually
impaired users.
| |
SetClickScript(IButtonControl, String) |
Set the onclick javascript for the IButtonControl button.
| |
SetClickScript(WebControl, String) |
Set the onclick javascript for any WebControl used as a button.
| |
SetOpacity |
Set CSS opacity on the specified element. Note that the style to use for opacity as well as the value
are browser-specific.
| |
UniqueIDSnapshot |
Accessing a control's UniqueID or ClientID too early can cause the ID to be cached. This is perfectly fine if the control's entire tree
of NamingContainers has been assembled, but accessing the ID before that can cause a partial ID to be constructed and cached. Once
cached there doesn't appear to be a way to clear it!
This methods contructs the UniqueID for the control from the control ID's in the control's NamingContainer hierarchy thus preventing
unwanted caching.
Here are a couple of reference articles:
Accessing ClientID or UniqueID too early can cause issues.Net Control.UniqueID implementation |