C# Класс Rock.Web.UI.RockPage

RockPage is the base abstract class that all page templates in Rock should inherit from
Наследование: System.Web.UI.Page
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
UserName string

Private Properties

Свойство Тип Описание
AddBlockMove void
AddGoogleAnalytics void
AddPopupControls void
AddTriggerPanel void
AddZoneElements void
GetCookieContext void
HtmlLinkExists bool
HtmlMetaExists bool
OnBlockUpdated void
SaveContextItem void
SetPage void

Открытые методы

Метод Описание
AddCSSLink ( Page page, string href, bool fingerprint = true ) : void

Adds a new CSS link that will be added to the page header prior to the page being rendered

AddCSSLink ( Page page, string href, string mediaType, bool fingerprint = true ) : void

Adds the CSS link to the page

AddCSSLink ( string href, bool fingerprint = true ) : void

Adds a new CSS link that will be added to the page header prior to the page being rendered

AddCSSLink ( string href, string mediaType, bool fingerprint = true ) : void

Adds the CSS link to the page

AddConfigurationUpdateTrigger ( UpdatePanel updatePanel ) : void

Adds an update trigger for when the block instance properties are updated.

AddHistory ( string key, string state, string title = "" ) : void

Adds a history point to the ScriptManager. Note: ScriptManager's EnableHistory property must be set to True

AddHtmlLink ( System.Web.UI.HtmlControls.HtmlLink htmlLink ) : void

Adds a new Html link that will be added to the page header prior to the page being rendered.

AddHtmlLink ( Page page, System.Web.UI.HtmlControls.HtmlLink htmlLink, string contentPlaceHolderId = "" ) : void

Adds a new Html link that will be added to the page header prior to the page being rendered

AddMetaTag ( System.Web.UI.HtmlControls.HtmlMeta htmlMeta ) : void

Adds a meta tag to the page header prior to the page being rendered

AddMetaTag ( Page page, System.Web.UI.HtmlControls.HtmlMeta htmlMeta ) : void

Adds a meta tag to the page

AddScriptLink ( Page page, string path, bool fingerprint = true ) : void

Adds a new script tag to the page header prior to the page being rendered

AddScriptLink ( string path, bool fingerprint = true ) : void

Adds a new script tag to the page header prior to the page being rendered.

AddScriptToHead ( Page page, string script, bool AddScriptTags ) : void

Adds the script to head.

DeleteUserPreference ( string key ) : void

Deletes a user preference value for the specified key

GetAttributeValue ( string key ) : string

Returns the current page's first value for the selected attribute If the attribute doesn't exist, null is returned

GetAttributeValues ( string key ) : List

Returns the current page's values for the selected attribute. If the attribute doesn't exist an empty list is returned.

GetClientIpAddress ( ) : string

Gets the client's ip address.

GetContextCookieName ( bool pageSpecific ) : string

Gets the name of the context cookie.

GetContextEntityTypes ( ) : List

Gets the context entity types.

GetCurrentContext ( Rock.Web.Cache.EntityTypeCache entity ) : Rock.Data.IEntity

Gets the current context object for a given entity type.

GetSharedItem ( string key ) : object

Retrieves an item from the current HTTPRequest items collection. This is useful to retrieve an object that was saved by a previous block on the same page.

GetUserPreference ( string key ) : string

Returns a user preference for the current user and given key.

GetUserPreferences ( string keyPrefix ) : string>.Dictionary

Returns the preference values for the current user that start with a given key.

HideSecondaryBlocks ( Rock.Web.UI.RockBlock caller, bool hidden ) : void

Hides any secondary blocks.

LoadGoogleMapsApi ( ) : void

Adds the google maps javascript API to the page

LogException ( Exception ex ) : void

Logs the exception.

PageParameter ( Rock.Web.UI.PageReference pageReference, string name ) : string

Checks the page reference's parms and querystring for a parameter matching the specified name, and if found returns the string

PageParameter ( string name, bool searchFormParams = false ) : string

Checks the page's RouteData values and then the query string for a parameter matching the specified name, and if found returns the string value

PageParameters ( ) : object>.Dictionary

Gets the page route and query string parameters

ResolveRockUrl ( string url ) : string

Returns a resolved Rock URL. Similar to System.Web.UI.Control's ResolveUrl method except that you can prefix a url with '~~' to indicate a virtual path to Rock's current theme root folder.

ResolveRockUrl ( string url, bool fingerprint ) : string

Resolves the rock URL.

ResolveRockUrlIncludeRoot ( string url ) : string

Resolves the rock URL and includes root.

SaveSharedItem ( string key, object item ) : void

Used to save an item to the current HTTPRequests items collection. This is useful if multiple blocks on the same page will need access to the same object. The first block can read the object and save it using this method for the other blocks to reference

SaveUserPreferences ( string keyPrefix ) : void

Saves the user preferences.

SessionUserPreferences ( ) : string>.Dictionary

Returns the current user's preferences, if they have previously been loaded into the session, they will be retrieved from there, otherwise they will be retrieved from the database, added to session and then returned

SetContextCookie ( IEntity entity, bool pageSpecific = false, bool refreshPage = true ) : void

Sets the context cookie.

SetUserPreference ( string key, string value, bool saveValue = true ) : void

Sets a user preference value for the specified key. If the key already exists, the value will be updated, if it is a new key it will be added. Value is then optionally saved to database.

UpdateBlocks ( string blockTypePath ) : void

Updates the blocks.

Защищенные методы

Метод Описание
FindRockControls ( System.Web.UI.ControlCollection controls ) : void

Recurses the page's System.Web.UI.ControlCollection looking for any Rock.Web.UI.Controls.Zone controls

FindZone ( string zoneName ) : Control

Find the Rock.Web.UI.Controls.Zone for the specified zone name. Looks in the Zones property to see if it has been defined. If an existing zone Rock.Web.UI.Controls.Zone cannot be found, the HtmlForm control is returned

InitializeCulture ( ) : void

Initializes the page's culture to use the culture specified by the browser ("auto")

OnInit ( EventArgs e ) : void

Loads all of the configured blocks for the current page into the control tree

OnLoad ( EventArgs e ) : void

Raises the E:System.Web.UI.Control.Load event.

OnSaveStateComplete ( EventArgs e ) : void

Raises the E:System.Web.UI.Page.SaveStateComplete event after the page state has been saved to the persistence medium.

scriptManager_Navigate ( object sender, System.Web.UI.HistoryEventArgs e ) : void

Handles the Navigate event of the scriptManager control.

trigger_Click ( object sender, EventArgs e ) : void

Handles the Click event of the trigger control.

Приватные методы

Метод Описание
AddBlockMove ( ) : void

Adds a control to move the block to another zone on the page.

AddGoogleAnalytics ( string code ) : void

Adds the google analytics script

AddPopupControls ( ) : void

Adds the popup controls.

AddTriggerPanel ( ) : void

Adds the config elements.

AddZoneElements ( bool canConfigPage ) : void

Adds the config elements.

GetCookieContext ( string cookieName ) : void
HtmlLinkExists ( Control parentControl, System.Web.UI.HtmlControls.HtmlLink newLink ) : bool

Returns a System.Boolean flag indicating if a specified parent control contains the specified HtmlLink.

HtmlMetaExists ( Page page, System.Web.UI.HtmlControls.HtmlMeta newMeta ) : bool

Returns a flag indicating if a meta tag exists on the page.

OnBlockUpdated ( int blockId ) : void

Called when a block's properties are updated.

SaveContextItem ( string key, object item ) : void
SetPage ( PageCache pageCache ) : void

Sets the page.

Описание методов

AddCSSLink() публичный статический Метод

Adds a new CSS link that will be added to the page header prior to the page being rendered
public static AddCSSLink ( Page page, string href, bool fingerprint = true ) : void
page System.Web.UI.Page The .
href string A representing the path to css file. Should be relative to layout template. Will be resolved at runtime
fingerprint bool if set to true [fingerprint].
Результат void

AddCSSLink() публичный статический Метод

Adds the CSS link to the page
public static AddCSSLink ( Page page, string href, string mediaType, bool fingerprint = true ) : void
page System.Web.UI.Page The .
href string A representing the path to css file. Should be relative to layout template. Will be resolved at runtime
mediaType string A representing the type of the media to use for the css link.
fingerprint bool if set to true [fingerprint].
Результат void

AddCSSLink() публичный Метод

Adds a new CSS link that will be added to the page header prior to the page being rendered
public AddCSSLink ( string href, bool fingerprint = true ) : void
href string A representing the path to css file. Should be relative to layout template. Will be resolved at runtime.
fingerprint bool if set to true [fingerprint].
Результат void

AddCSSLink() публичный Метод

Adds the CSS link to the page
public AddCSSLink ( string href, string mediaType, bool fingerprint = true ) : void
href string A representing the path to css file. Should be relative to layout template. Will be resolved at runtime
mediaType string A representing the type of the media to use for the css link.
fingerprint bool if set to true [fingerprint].
Результат void

AddConfigurationUpdateTrigger() публичный Метод

Adds an update trigger for when the block instance properties are updated.
public AddConfigurationUpdateTrigger ( UpdatePanel updatePanel ) : void
updatePanel System.Web.UI.UpdatePanel The to add the to.
Результат void

AddHistory() публичный Метод

Adds a history point to the ScriptManager. Note: ScriptManager's EnableHistory property must be set to True
public AddHistory ( string key, string state, string title = "" ) : void
key string A representing the key to use for the history point.
state string A representing any state information to store for the history point.
title string A representing the title to be used by the browser, will use an empty string by default.
Результат void

AddHtmlLink() публичный Метод

Adds a new Html link that will be added to the page header prior to the page being rendered.
public AddHtmlLink ( System.Web.UI.HtmlControls.HtmlLink htmlLink ) : void
htmlLink System.Web.UI.HtmlControls.HtmlLink The .
Результат void

AddHtmlLink() публичный статический Метод

Adds a new Html link that will be added to the page header prior to the page being rendered
public static AddHtmlLink ( Page page, System.Web.UI.HtmlControls.HtmlLink htmlLink, string contentPlaceHolderId = "" ) : void
page System.Web.UI.Page The .
htmlLink System.Web.UI.HtmlControls.HtmlLink The to add to the page.
contentPlaceHolderId string A representing the Id of the content placeholder to add the link to.
Результат void

AddMetaTag() публичный Метод

Adds a meta tag to the page header prior to the page being rendered
public AddMetaTag ( System.Web.UI.HtmlControls.HtmlMeta htmlMeta ) : void
htmlMeta System.Web.UI.HtmlControls.HtmlMeta The tag.
Результат void

AddMetaTag() публичный статический Метод

Adds a meta tag to the page
public static AddMetaTag ( Page page, System.Web.UI.HtmlControls.HtmlMeta htmlMeta ) : void
page System.Web.UI.Page The .
htmlMeta System.Web.UI.HtmlControls.HtmlMeta A representing the HTML meta tag.
Результат void

AddScriptLink() публичный статический Метод

Adds a new script tag to the page header prior to the page being rendered
public static AddScriptLink ( Page page, string path, bool fingerprint = true ) : void
page System.Web.UI.Page The .
path string A representing the path to script file. Should be relative to layout template. Will be resolved at runtime.
fingerprint bool if set to true [fingerprint].
Результат void

AddScriptLink() публичный Метод

Adds a new script tag to the page header prior to the page being rendered.
public AddScriptLink ( string path, bool fingerprint = true ) : void
path string A representing the path to the script link.
fingerprint bool if set to true [fingerprint].
Результат void

AddScriptToHead() публичный статический Метод

Adds the script to head.
public static AddScriptToHead ( Page page, string script, bool AddScriptTags ) : void
page System.Web.UI.Page The page.
script string The script.
AddScriptTags bool if set to true [add script tags].
Результат void

DeleteUserPreference() публичный Метод

Deletes a user preference value for the specified key
public DeleteUserPreference ( string key ) : void
key string A representing the name of the key.
Результат void

FindRockControls() защищенный Метод

Recurses the page's System.Web.UI.ControlCollection looking for any Rock.Web.UI.Controls.Zone controls
protected FindRockControls ( System.Web.UI.ControlCollection controls ) : void
controls System.Web.UI.ControlCollection A containing the page's controls.
Результат void

FindZone() защищенный Метод

Find the Rock.Web.UI.Controls.Zone for the specified zone name. Looks in the Zones property to see if it has been defined. If an existing zone Rock.Web.UI.Controls.Zone cannot be found, the HtmlForm control is returned
protected FindZone ( string zoneName ) : Control
zoneName string A representing the name of the zone.
Результат System.Web.UI.Control

GetAttributeValue() публичный Метод

Returns the current page's first value for the selected attribute If the attribute doesn't exist, null is returned
public GetAttributeValue ( string key ) : string
key string A representing the argument key.
Результат string

GetAttributeValues() публичный Метод

Returns the current page's values for the selected attribute. If the attribute doesn't exist an empty list is returned.
public GetAttributeValues ( string key ) : List
key string A representing the key of the selected attribute ///
Результат List

GetClientIpAddress() публичный статический Метод

Gets the client's ip address.
public static GetClientIpAddress ( ) : string
Результат string

GetContextCookieName() публичный Метод

Gets the name of the context cookie.
public GetContextCookieName ( bool pageSpecific ) : string
pageSpecific bool if set to true [page specific].
Результат string

GetContextEntityTypes() публичный Метод

Gets the context entity types.
public GetContextEntityTypes ( ) : List
Результат List

GetCurrentContext() публичный Метод

Gets the current context object for a given entity type.
public GetCurrentContext ( Rock.Web.Cache.EntityTypeCache entity ) : Rock.Data.IEntity
entity Rock.Web.Cache.EntityTypeCache The containing a reference to the entity.
Результат Rock.Data.IEntity

GetSharedItem() публичный Метод

Retrieves an item from the current HTTPRequest items collection. This is useful to retrieve an object that was saved by a previous block on the same page.
public GetSharedItem ( string key ) : object
key string A representing the object's key value.
Результат object

GetUserPreference() публичный Метод

Returns a user preference for the current user and given key.
public GetUserPreference ( string key ) : string
key string A representing the key to the user preference.
Результат string

GetUserPreferences() публичный Метод

Returns the preference values for the current user that start with a given key.
public GetUserPreferences ( string keyPrefix ) : string>.Dictionary
keyPrefix string A representing the key prefix. Preference values, for the current user, with a key that begins with this value will be included.
Результат string>.Dictionary

HideSecondaryBlocks() публичный Метод

Hides any secondary blocks.
public HideSecondaryBlocks ( Rock.Web.UI.RockBlock caller, bool hidden ) : void
caller Rock.Web.UI.RockBlock The that is the caller
hidden bool A value that signifies if secondary blocks should be hidden.
Результат void

InitializeCulture() защищенный Метод

Initializes the page's culture to use the culture specified by the browser ("auto")
protected InitializeCulture ( ) : void
Результат void

LoadGoogleMapsApi() публичный Метод

Adds the google maps javascript API to the page
public LoadGoogleMapsApi ( ) : void
Результат void

LogException() публичный Метод

Logs the exception.
public LogException ( Exception ex ) : void
ex System.Exception The to log.
Результат void

OnInit() защищенный Метод

Loads all of the configured blocks for the current page into the control tree
protected OnInit ( EventArgs e ) : void
e System.EventArgs
Результат void

OnLoad() защищенный Метод

Raises the E:System.Web.UI.Control.Load event.
protected OnLoad ( EventArgs e ) : void
e System.EventArgs The object that contains the event data.
Результат void

OnSaveStateComplete() защищенный Метод

Raises the E:System.Web.UI.Page.SaveStateComplete event after the page state has been saved to the persistence medium.
protected OnSaveStateComplete ( EventArgs e ) : void
e System.EventArgs A object containing the event data.
Результат void

PageParameter() публичный Метод

Checks the page reference's parms and querystring for a parameter matching the specified name, and if found returns the string
public PageParameter ( Rock.Web.UI.PageReference pageReference, string name ) : string
pageReference Rock.Web.UI.PageReference The .
name string A containing the name of the parameter.
Результат string

PageParameter() публичный Метод

Checks the page's RouteData values and then the query string for a parameter matching the specified name, and if found returns the string value
public PageParameter ( string name, bool searchFormParams = false ) : string
name string A representing the name of the page parameter.
searchFormParams bool if set to true [search form parameters].
Результат string

PageParameters() публичный Метод

Gets the page route and query string parameters
public PageParameters ( ) : object>.Dictionary
Результат object>.Dictionary

ResolveRockUrl() публичный Метод

Returns a resolved Rock URL. Similar to System.Web.UI.Control's ResolveUrl method except that you can prefix a url with '~~' to indicate a virtual path to Rock's current theme root folder.
public ResolveRockUrl ( string url ) : string
url string A representing the URL to resolve.
Результат string

ResolveRockUrl() публичный Метод

Resolves the rock URL.
public ResolveRockUrl ( string url, bool fingerprint ) : string
url string The URL.
fingerprint bool if set to true [fingerprint].
Результат string

ResolveRockUrlIncludeRoot() публичный Метод

Resolves the rock URL and includes root.
public ResolveRockUrlIncludeRoot ( string url ) : string
url string The URL.
Результат string

SaveSharedItem() публичный Метод

Used to save an item to the current HTTPRequests items collection. This is useful if multiple blocks on the same page will need access to the same object. The first block can read the object and save it using this method for the other blocks to reference
public SaveSharedItem ( string key, object item ) : void
key string A representing the item's key
item object The to save.
Результат void

SaveUserPreferences() публичный Метод

Saves the user preferences.
public SaveUserPreferences ( string keyPrefix ) : void
keyPrefix string The key prefix.
Результат void

SessionUserPreferences() публичный Метод

Returns the current user's preferences, if they have previously been loaded into the session, they will be retrieved from there, otherwise they will be retrieved from the database, added to session and then returned
public SessionUserPreferences ( ) : string>.Dictionary
Результат string>.Dictionary

SetContextCookie() публичный Метод

Sets the context cookie.
public SetContextCookie ( IEntity entity, bool pageSpecific = false, bool refreshPage = true ) : void
entity IEntity The entity.
pageSpecific bool if set to true [page specific].
refreshPage bool if set to true [refresh page].
Результат void

SetUserPreference() публичный Метод

Sets a user preference value for the specified key. If the key already exists, the value will be updated, if it is a new key it will be added. Value is then optionally saved to database.
public SetUserPreference ( string key, string value, bool saveValue = true ) : void
key string A representing the name of the key.
value string A representing the preference value.
saveValue bool if set to true [save value].
Результат void

UpdateBlocks() публичный Метод

Updates the blocks.
public UpdateBlocks ( string blockTypePath ) : void
blockTypePath string The block type path.
Результат void

scriptManager_Navigate() защищенный Метод

Handles the Navigate event of the scriptManager control.
protected scriptManager_Navigate ( object sender, System.Web.UI.HistoryEventArgs e ) : void
sender object The source of the event.
e System.Web.UI.HistoryEventArgs The instance containing the event data.
Результат void

trigger_Click() защищенный Метод

Handles the Click event of the trigger control.
protected trigger_Click ( object sender, EventArgs e ) : void
sender object The source of the event.
e System.EventArgs The instance containing the event data.
Результат void

Описание свойств

UserName защищенное свойство

The full name of the currently logged in user
protected string UserName
Результат string