Click or drag to resize

EAPCtrlUtils Class

Utility methods for working with .Net controls.
Inheritance Hierarchy
SystemObject
  NetQuarryEAPCtrlUtils

Namespace:  NetQuarry
Assembly:  EAP.Core (in EAP.Core.dll) Version: 2.0.0.0 (4.6.8.0)
Syntax
public static class EAPCtrlUtils

The EAPCtrlUtils type exposes the following members.

Methods
  NameDescription
Public methodStatic memberAddEventHandler(WebControl, String, String, Boolean)
Add a new javascript event handler (e.g. onclick) to a control without overwriting any existing handler.
Public methodStatic memberAddEventHandler(WebControl, String, String, Boolean, Boolean)
Add a new javascript event handler (e.g. onclick) to a control without overwriting any existing handler.
Public methodStatic memberAddPaneF8Info(IAppContext, Page, IConsolePane)
Add F8 debug info for the console pane.
Public methodStatic memberAddPaneF8Info(IAppContext, Page, IWizContainerPane)
Add F8 debug info for the WizGrouper pane.
Public methodStatic memberApplyClassAndStyle(HtmlControl, String, String)
Set the CssClass and Style pairs on the control. Each is set only if that string is non-null/non-empty.
Public methodStatic memberApplyClassAndStyle(WebControl, String, String)
Set the CssClass and Style pairs on the control. Each is set only if that string is non-null/non-empty.
Public methodStatic memberApplyF8Fixes
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.
Public methodStatic memberApplyTagAttributes
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).
Public methodStatic memberClosestParent
Finds the closest parent control that "is" the specified type and, if cssClass is specified, has the specified CssClass.
Public methodStatic memberFindControlRecursive
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.
Public methodStatic memberGetAttribute
Gets the specified Attribute for the control. The control can be a WebControl or an HtmlControl.
Public methodStatic memberGetCssClass
Gets the CssClass for the control. The control can be a WebControl or an HtmlControl.
Public methodStatic memberGetDocType
Returns the DOCTYPE string
Public methodStatic memberHasCssClass
Determines whether or not the specified control has the specified CssClass. Note that if cssClass is null/empty then true is always returned.
Public methodStatic memberHasVisibleControls
Determines whether or not the control has any visible controls in its controls collection.
Public methodStatic memberHeightForcer
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.
Public methodStatic memberHeightForcerHtml
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.
Public methodStatic memberLoadControl
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.
Public methodStatic memberMergeCssClass(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.
Public methodStatic memberMergeCssClass(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.
Public methodStatic memberMergeCssClass(HtmlControl, String)
Add the specified CSS class name(s) to the control's CssClass list.
Public methodStatic memberMergeCssClass(WebControl, String)
Add the specified CSS class name(s) to the control's CssClass list.
Public methodStatic memberMoveAttribute
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.
Public methodStatic memberOnClickAppend(HtmlInputButton, String)
Append the specified javascript to the button's onclick script, if any. See also OnClickPrepend(HtmlInputButton, String).
Public methodStatic memberOnClickAppend(TextBox, String, String)
Append the specified javascript to the textbox's onclick script, if any.
Public methodStatic memberOnClickPrepend
Prepend the specified javascript to the button's onclick script, if any. See also OnClickAppend(HtmlInputButton, String).
Public methodStatic memberPostInfoGet
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.
Public methodStatic memberPostInfoSet
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.
Public methodStatic memberReaderToTable(DataTable)
Reads a DataTable into an HTML table. The table will always include a header row. The header row will have the "hdr" CSSClass.
Public methodStatic memberReaderToTable(IDataReader)
Reads a DataReader into an HTML table. The table will always include a header row. The header row will have the "hdr" CSSClass.
Public methodStatic memberRemoveCssClass(HtmlControl, String)
Remove the specified CSS class name from the control's class list.
Public methodStatic memberRemoveCssClass(WebControl, String)
Remove the specified CSS class name from the control's CssClass list.
Public methodStatic memberRemovePositioningStyles
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.
Public methodStatic memberRemoveStyle
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!
Public methodStatic memberReplaceAnchors
HTML does not allow nested anchor tags. This code replaces any anchor opening and/or closing tags with corresponding SPAN tags.
Public methodStatic memberReplaceWith
Replace this control in its parent's Controls collection, with the specified replacement. If either control is null, no replacement is performed.
Public methodStatic memberReverseControls
Reverse the order of the controls in the collection. Note that to do this the controls may be removed from the collection and readded.
Public methodStatic memberScreenReaderIgnore
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.
Public methodStatic memberSetClickScript(IButtonControl, String)
Set the onclick javascript for the IButtonControl button.
Public methodStatic memberSetClickScript(WebControl, String)
Set the onclick javascript for any WebControl used as a button.
Public methodStatic memberSetOpacity
Set CSS opacity on the specified element. Note that the style to use for opacity as well as the value are browser-specific.
Public methodStatic memberUniqueIDSnapshot
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
Top
Fields
  NameDescription
Public fieldStatic memberImg1x1Black
Renders an IMG tag with an inline black 1x1 image.
Public fieldStatic memberImg1x1Transparent
Renders an IMG tag with an inline transparent 1x1 image.
Top
See Also