C# Class Subtext.Web.Controls.ControlHelper

Static class containing helper methods for various controls that can't be placed within the control hierarchy.
Show file Open project: ayende/Subtext

Public Methods

Method Description
AddCssClass ( HtmlControl control, string cssClass ) : void
AddCssClass ( WebControl control, string cssClass ) : void
ApplyRecursively ( ControlAction controlAction, Control root ) : void

Applies the specified control action recursively.

ExportToExcel ( Control control, string filename ) : void

Exports the specified control to excel.

Calling this function will prompt the user with a dialog to save the trade blotter grid as an Excel file named TradeBlotter.xls.

FindControlRecursively ( Control parent, string id ) : Control

Recursively searches for the server form.

GetPageFormClientId ( Control parent ) : string

Recursively searches for the server form's client id.

IsAttributeDefined ( HtmlControl control, string name ) : bool

Returns true if the specified attribute is defined on the control.

IsAttributeDefined ( WebControl control, string name ) : bool

Returns true if the specified attribute is defined on the control.

SetTitleIfNone ( HyperLink link, string title ) : void
SetTitleIfNone ( LinkButton link, string title ) : void

Private Methods

Method Description
SetTitleIfNoneInternal ( WebControl link, string title ) : void

Sets the title attribute for the hyperlink if none exists.

Method Details

AddCssClass() public static method

public static AddCssClass ( HtmlControl control, string cssClass ) : void
control System.Web.UI.HtmlControls.HtmlControl
cssClass string
return void

AddCssClass() public static method

public static AddCssClass ( WebControl control, string cssClass ) : void
control System.Web.UI.WebControls.WebControl
cssClass string
return void

ApplyRecursively() public static method

Applies the specified control action recursively.
public static ApplyRecursively ( ControlAction controlAction, Control root ) : void
controlAction ControlAction The control action.
root System.Web.UI.Control The root control.
return void

ExportToExcel() public static method

Exports the specified control to excel.
Calling this function will prompt the user with a dialog to save the trade blotter grid as an Excel file named TradeBlotter.xls.
public static ExportToExcel ( Control control, string filename ) : void
control System.Web.UI.Control
filename string
return void

FindControlRecursively() public static method

Recursively searches for the server form.
public static FindControlRecursively ( Control parent, string id ) : Control
parent System.Web.UI.Control The parent to start the recursive search from.
id string Id of the control to find.
return System.Web.UI.Control

GetPageFormClientId() public static method

Recursively searches for the server form's client id.
public static GetPageFormClientId ( Control parent ) : string
parent System.Web.UI.Control The parent.
return string

IsAttributeDefined() public static method

Returns true if the specified attribute is defined on the control.
public static IsAttributeDefined ( HtmlControl control, string name ) : bool
control System.Web.UI.HtmlControls.HtmlControl Control.
name string Name.
return bool

IsAttributeDefined() public static method

Returns true if the specified attribute is defined on the control.
public static IsAttributeDefined ( WebControl control, string name ) : bool
control System.Web.UI.WebControls.WebControl Control.
name string Name.
return bool

SetTitleIfNone() public static method

public static SetTitleIfNone ( HyperLink link, string title ) : void
link System.Web.UI.WebControls.HyperLink
title string
return void

SetTitleIfNone() public static method

public static SetTitleIfNone ( LinkButton link, string title ) : void
link System.Web.UI.WebControls.LinkButton
title string
return void