Home

Castle Stronghold

Table of contents

Controller API Document

Implements the core functionality and exposes the common methods for concrete controllers.

Constructors

Controller()

Constructs a Controller

Properties

NameTypeDescription
MetaDescriptorControllerMetaDescriptor This is intended to be used by MonoRail infrastructure.
ActionsICollection Gets the actions available in this controller.
ResourcesResourceDictionary Gets a dicitionary of name/Castle.MonoRail.Framework.IResource
HelpersIDictionary Gets a dictionary of name/helper instance
NameString Gets the controller's name.
AreaNameString Gets the controller's area name.
LayoutNameString Gets or set the layout being used.
ActionString Gets the name of the action being processed.
LoggerILogger Logger for the controller
SelectedViewNameString Gets or sets the view which will be rendered by this action.
PropertyBagIDictionary Gets the property bag, which is used to pass variables to the view.
ContextIRailsEngineContext Gets the context of this request execution.
SessionIDictionary Gets the Session dictionary.
FlashFlash Gets a dictionary of volative items. Ideal for showing success and failures messages.
HttpContextHttpContext Gets the web context of ASP.NET API.
RequestIRequest Gets the request object.
ResponseIResponse Gets the response object.
ParamsNameValueCollection Shortcut to Castle.MonoRail.Framework.IRequest.Params
FormNameValueCollection Shortcut to Castle.MonoRail.Framework.IRequest.Form
QueryNameValueCollection Shortcut to Castle.MonoRail.Framework.IRequest.QueryString
DynamicActionsIDictionary
CustomActionsIDictionary
IsClientConnectedBoolean Shortcut to Castle.MonoRail.Framework.IResponse.IsClientConnected
IsPostBackBoolean Determines if the current Action resulted from an ASP.NET PostBack. As a result, this property is only relavent when using WebForms views. It is placed on the base Controller for convenience only to avoid the need to extend the Controller or provide additional helper classes.
ServiceProviderIServiceProvider

Methods

PostSendView(Object view)

Invoked by the view engine to perform any logic after the view had been sent to the client.

ParameterDescription
view

PreSendView(Object view)

Invoked by the view engine to perform any logic before the view is sent to the client.

ParameterDescription
view

Initialize()

Missing summary

GetRescueFor(IList rescues, Type exceptionType) : RescueDescriptor

Missing summary

ParameterDescription
rescues Missing documentation
exceptionType Missing documentation

PerformRescue(MethodInfo method, Exception ex) : Boolean

Missing summary

ParameterDescription
method Missing documentation
ex Missing documentation

ObtainDefaultLayoutName() : String

Missing summary

ReleaseResources()

Missing summary

CreateResources(MethodInfo method)

Missing summary

ParameterDescription
method Missing documentation

InvokeMethod(MethodInfo method, IRequest request, Object[] methodArgs)

Pendent

ParameterDescription
method
request
methodArgs

SelectMethod(String action, IDictionary actions, IRequest request, Object[] actionArgs) : MethodInfo

Pendent

ParameterDescription
action
actions
request
actionArgs

CreateAndInitializeHelpers()

Missing summary

InternalSend(String action, Object[] actionArgs)

Performs the specified action, which means:

1. Define the default view name

2. Run the before filters

3. Select the method related to the action name and invoke it

4. On error, execute the rescues if available

5. Run the after filters

6. Invoke the view engine

ParameterDescription
action Action name
actionArgs Action arguments

Redirect(String url, IDictionary parameters)

Redirects to the specified URL.

ParameterDescription
url Target URL
parameters URL parameters

Redirect(String url)

Redirects to the specified URL. All other Redirects call this one.

ParameterDescription
url Target URL

RenderView(String name)

Specifies the view to be processed after the action has finished its processing.

ParameterDescription
name Missing documentation

RenderView(String name, Boolean skipLayout)

Specifies the view to be processed after the action has finished its processing.

ParameterDescription
name Missing documentation
skipLayout Missing documentation

RenderView(String controller, String name)

Specifies the view to be processed after the action has finished its processing.

ParameterDescription
controller Missing documentation
name Missing documentation

RenderView(String controller, String name, Boolean skipLayout)

Specifies the view to be processed after the action has finished its processing.

ParameterDescription
controller Missing documentation
name Missing documentation
skipLayout Missing documentation

InPlaceRenderView(TextWriter output, String name)

Specifies the view to be processed and results are written to System.IO.TextWriter.

ParameterDescription
output
name The name of the view to process.

RenderSharedView(String name)

Specifies the shared view to be processed after the action has finished its processing. (A partial view shared by others views and usually in the root folder of the view directory).

ParameterDescription
name Missing documentation

RenderSharedView(String name, Boolean skipLayout)

Specifies the shared view to be processed after the action has finished its processing. (A partial view shared by others views and usually in the root folder of the view directory).

ParameterDescription
name Missing documentation
skipLayout Missing documentation

InPlaceRenderSharedView(TextWriter output, String name)

Specifies the shared view to be processed and results are written to System.IO.TextWriter. (A partial view shared by others views and usually in the root folder of the view directory).

ParameterDescription
output
name The name of the view to process.

CancelView()

Cancels the view processing.

CancelLayout()

Cancels the layout processing.

RenderText(String contents)

Cancels the view processing and writes the specified contents to the browser

ParameterDescription
contents Missing documentation

RenderText(String contents, Object[] args)

Cancels the view processing and writes the specified contents to the browser

ParameterDescription
contents Missing documentation
args Missing documentation

RenderText(IFormatProvider formatProvider, String contents, Object[] args)

Cancels the view processing and writes the specified contents to the browser

ParameterDescription
formatProvider Missing documentation
contents Missing documentation
args Missing documentation

DirectRender(String contents)

Sends raw contents to be rendered directly by the view engine. It's up to the view engine just to apply the layout and nothing else.

ParameterDescription
contents Contents to be rendered.

HasTemplate(String templateName) : Boolean

Returns true if the specified template exists.

ParameterDescription
templateName

RedirectToAction(String action)

Redirects to another action in the same controller.

ParameterDescription
action The action name

RedirectToAction(String action, String[] queryStringParameters)

Redirects to another action in the same controller.

ParameterDescription
action The action name
queryStringParameters list of key/value pairs. Each string is supposed to have the format "key=value" that will be converted to a proper query string

RedirectToAction(String action, IDictionary queryStringParameters)

Redirects to another action in the same controller.

ParameterDescription
action The action name
queryStringParameters Query string entries

RedirectToAction(String action, NameValueCollection queryStringParameters)

Redirects to another action in the same controller.

ParameterDescription
action The action name
queryStringParameters Query string entries

CreateAbsoluteRailsUrl(String area, String controller, String action) : String

Missing summary

ParameterDescription
area Missing documentation
controller Missing documentation
action Missing documentation

CreateAbsoluteRailsUrl(String controller, String action) : String

Missing summary

ParameterDescription
controller Missing documentation
action Missing documentation

CreateAbsoluteRailsUrlForAction(String action) : String

Missing summary

ParameterDescription
action Missing documentation

Redirect(String controller, String action)

Redirects to another controller and action.

ParameterDescription
controller Controller name
action Action name

Redirect(String area, String controller, String action)

Redirects to another controller and action.

ParameterDescription
area Area name
controller Controller name
action Action name

Redirect(String controller, String action, NameValueCollection parameters)

Redirects to another controller and action with the specified paramters.

ParameterDescription
controller Controller name
action Action name
parameters Key/value pairings

Redirect(String area, String controller, String action, NameValueCollection parameters)

Redirects to another controller and action with the specified paramters.

ParameterDescription
area Area name
controller Controller name
action Action name
parameters Key/value pairings

Redirect(String controller, String action, IDictionary parameters)

Redirects to another controller and action with the specified paramters.

ParameterDescription
controller Controller name
action Action name
parameters Key/value pairings

Redirect(String area, String controller, String action, IDictionary parameters)

Redirects to another controller and action with the specified paramters.

ParameterDescription
area Area name
controller Controller name
action Action name
parameters Key/value pairings

ToQueryString(NameValueCollection parameters) : String

Missing summary

ParameterDescription
parameters Missing documentation

ToQueryString(IDictionary parameters) : String

Missing summary

ParameterDescription
parameters Missing documentation

Send(String action)

Performs the specified action, which means:

1. Define the default view name

2. Run the before filters

3. Select the method related to the action name and invoke it

4. On error, execute the rescues if available

5. Run the after filters

6. Invoke the view engine

ParameterDescription
action Action name

Send(String action, Object[] actionArgs)

Performs the specified action with arguments.

ParameterDescription
action Action name
actionArgs Action arguments

ShouldSkip(MethodInfo method, IDictionary filtersToSkip) : Boolean

Missing summary

ParameterDescription
method Missing documentation
filtersToSkip Missing documentation

CopyFilterDescriptors() : FilterDescriptor[]

Clones all Filter descriptors, in order to get a writable copy.

RenderMailMessage(String templateName) : Message

Creates an instance of Castle.Components.Common.EmailSender.Message using the specified template for the body

ParameterDescription
templateName Name of the template to load. Will look in Views/mail for that template file.

DeliverEmail(Message message)

Attempts to deliver the Message using the server specified on the web.config.

ParameterDescription
message The instance of System.Web.Mail.MailMessage that will be sent

RenderEmailAndSend(String templateName)

Renders and delivers the e-mail message.

ParameterDescription
templateName

RaiseOnActionExceptionOnExtension()

Missing summary

Google
Search WWW Search castleproject.org