Table of contents
- 1 Constructors
- 2 Properties
- 3 Methods
- 3.1 PostSendView(Object view)
- 3.2 PreSendView(Object view)
- 3.3 Initialize()
- 3.4 GetRescueFor(IList rescues, Type exceptionType) : RescueDescriptor
- 3.5 PerformRescue(MethodInfo method, Exception ex) : Boolean
- 3.6 ObtainDefaultLayoutName() : String
- 3.7 ReleaseResources()
- 3.8 CreateResources(MethodInfo method)
- 3.9 InvokeMethod(MethodInfo method, IRequest request, Object[] methodArgs)
- 3.10 SelectMethod(String action, IDictionary actions, IRequest request, Object[] actionArgs) : MethodInfo
- 3.11 CreateAndInitializeHelpers()
- 3.12 InternalSend(String action, Object[] actionArgs)
- 3.13 Redirect(String url, IDictionary parameters)
- 3.14 Redirect(String url)
- 3.15 RenderView(String name)
- 3.16 RenderView(String name, Boolean skipLayout)
- 3.17 RenderView(String controller, String name)
- 3.18 RenderView(String controller, String name, Boolean skipLayout)
- 3.19 InPlaceRenderView(TextWriter output, String name)
- 3.20 RenderSharedView(String name)
- 3.21 RenderSharedView(String name, Boolean skipLayout)
- 3.22 InPlaceRenderSharedView(TextWriter output, String name)
- 3.23 CancelView()
- 3.24 CancelLayout()
- 3.25 RenderText(String contents)
- 3.26 RenderText(String contents, Object[] args)
- 3.27 RenderText(IFormatProvider formatProvider, String contents, Object[] args)
- 3.28 DirectRender(String contents)
- 3.29 HasTemplate(String templateName) : Boolean
- 3.30 RedirectToAction(String action)
- 3.31 RedirectToAction(String action, String[] queryStringParameters)
- 3.32 RedirectToAction(String action, IDictionary queryStringParameters)
- 3.33 RedirectToAction(String action, NameValueCollection queryStringParameters)
- 3.34 CreateAbsoluteRailsUrl(String area, String controller, String action) : String
- 3.35 CreateAbsoluteRailsUrl(String controller, String action) : String
- 3.36 CreateAbsoluteRailsUrlForAction(String action) : String
- 3.37 Redirect(String controller, String action)
- 3.38 Redirect(String area, String controller, String action)
- 3.39 Redirect(String controller, String action, NameValueCollection parameters)
- 3.40 Redirect(String area, String controller, String action, NameValueCollection parameters)
- 3.41 Redirect(String controller, String action, IDictionary parameters)
- 3.42 Redirect(String area, String controller, String action, IDictionary parameters)
- 3.43 ToQueryString(NameValueCollection parameters) : String
- 3.44 ToQueryString(IDictionary parameters) : String
- 3.45 Send(String action)
- 3.46 Send(String action, Object[] actionArgs)
- 3.47 ShouldSkip(MethodInfo method, IDictionary filtersToSkip) : Boolean
- 3.48 CopyFilterDescriptors() : FilterDescriptor[]
- 3.49 RenderMailMessage(String templateName) : Message
- 3.50 DeliverEmail(Message message)
- 3.51 RenderEmailAndSend(String templateName)
- 3.52 RaiseOnActionExceptionOnExtension()
Controller API Document
Implements the core functionality and exposes the common methods for concrete controllers.
Constructors
Controller()
Constructs a Controller
Properties
| Name | Type | Description |
|---|---|---|
| MetaDescriptor | ControllerMetaDescriptor | This is intended to be used by MonoRail infrastructure. |
| Actions | ICollection | Gets the actions available in this controller. |
| Resources | ResourceDictionary | Gets a dicitionary of name/Castle.MonoRail.Framework.IResource |
| Helpers | IDictionary | Gets a dictionary of name/helper instance |
| Name | String | Gets the controller's name. |
| AreaName | String | Gets the controller's area name. |
| LayoutName | String | Gets or set the layout being used. |
| Action | String | Gets the name of the action being processed. |
| Logger | ILogger | Logger for the controller |
| SelectedViewName | String | Gets or sets the view which will be rendered by this action. |
| PropertyBag | IDictionary | Gets the property bag, which is used to pass variables to the view. |
| Context | IRailsEngineContext | Gets the context of this request execution. |
| Session | IDictionary | Gets the Session dictionary. |
| Flash | Flash | Gets a dictionary of volative items. Ideal for showing success and failures messages. |
| HttpContext | HttpContext | Gets the web context of ASP.NET API. |
| Request | IRequest | Gets the request object. |
| Response | IResponse | Gets the response object. |
| Params | NameValueCollection | Shortcut to Castle.MonoRail.Framework.IRequest.Params |
| Form | NameValueCollection | Shortcut to Castle.MonoRail.Framework.IRequest.Form |
| Query | NameValueCollection | Shortcut to Castle.MonoRail.Framework.IRequest.QueryString |
| DynamicActions | IDictionary | |
| CustomActions | IDictionary | |
| IsClientConnected | Boolean | Shortcut to Castle.MonoRail.Framework.IResponse.IsClientConnected |
| IsPostBack | Boolean | 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. |
| ServiceProvider | IServiceProvider |
Methods
PostSendView(Object view)
Invoked by the view engine to perform any logic after the view had been sent to the client.
| Parameter | Description |
|---|---|
| view |
PreSendView(Object view)
Invoked by the view engine to perform any logic before the view is sent to the client.
| Parameter | Description |
|---|---|
| view |
Initialize()
Missing summary
GetRescueFor(IList rescues, Type exceptionType) : RescueDescriptor
Missing summary
| Parameter | Description |
|---|---|
| rescues | Missing documentation |
| exceptionType | Missing documentation |
PerformRescue(MethodInfo method, Exception ex) : Boolean
Missing summary
| Parameter | Description |
|---|---|
| method | Missing documentation |
| ex | Missing documentation |
ObtainDefaultLayoutName() : String
Missing summary
ReleaseResources()
Missing summary
CreateResources(MethodInfo method)
Missing summary
| Parameter | Description |
|---|---|
| method | Missing documentation |
InvokeMethod(MethodInfo method, IRequest request, Object[] methodArgs)
Pendent
| Parameter | Description |
|---|---|
| method | |
| request | |
| methodArgs |
SelectMethod(String action, IDictionary actions, IRequest request, Object[] actionArgs) : MethodInfo
Pendent
| Parameter | Description |
|---|---|
| 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
| Parameter | Description |
|---|---|
| action | Action name |
| actionArgs | Action arguments |
Redirect(String url, IDictionary parameters)
Redirects to the specified URL.
| Parameter | Description |
|---|---|
| url | Target URL |
| parameters | URL parameters |
Redirect(String url)
Redirects to the specified URL. All other Redirects call this one.
| Parameter | Description |
|---|---|
| url | Target URL |
RenderView(String name)
Specifies the view to be processed after the action has finished its processing.
| Parameter | Description |
|---|---|
| name | Missing documentation |
RenderView(String name, Boolean skipLayout)
Specifies the view to be processed after the action has finished its processing.
| Parameter | Description |
|---|---|
| name | Missing documentation |
| skipLayout | Missing documentation |
RenderView(String controller, String name)
Specifies the view to be processed after the action has finished its processing.
| Parameter | Description |
|---|---|
| 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.
| Parameter | Description |
|---|---|
| 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.
| Parameter | Description |
|---|---|
| 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).
| Parameter | Description |
|---|---|
| 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).
| Parameter | Description |
|---|---|
| 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).
| Parameter | Description |
|---|---|
| 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
| Parameter | Description |
|---|---|
| contents | Missing documentation |
RenderText(String contents, Object[] args)
Cancels the view processing and writes the specified contents to the browser
| Parameter | Description |
|---|---|
| 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
| Parameter | Description |
|---|---|
| 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.
| Parameter | Description |
|---|---|
| contents | Contents to be rendered. |
HasTemplate(String templateName) : Boolean
Returns true if the specified template exists.
| Parameter | Description |
|---|---|
| templateName |
RedirectToAction(String action)
Redirects to another action in the same controller.
| Parameter | Description |
|---|---|
| action | The action name |
RedirectToAction(String action, String[] queryStringParameters)
Redirects to another action in the same controller.
| Parameter | Description |
|---|---|
| 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.
| Parameter | Description |
|---|---|
| action | The action name |
| queryStringParameters | Query string entries |
RedirectToAction(String action, NameValueCollection queryStringParameters)
Redirects to another action in the same controller.
| Parameter | Description |
|---|---|
| action | The action name |
| queryStringParameters | Query string entries |
CreateAbsoluteRailsUrl(String area, String controller, String action) : String
Missing summary
| Parameter | Description |
|---|---|
| area | Missing documentation |
| controller | Missing documentation |
| action | Missing documentation |
CreateAbsoluteRailsUrl(String controller, String action) : String
Missing summary
| Parameter | Description |
|---|---|
| controller | Missing documentation |
| action | Missing documentation |
CreateAbsoluteRailsUrlForAction(String action) : String
Missing summary
| Parameter | Description |
|---|---|
| action | Missing documentation |
Redirect(String controller, String action)
Redirects to another controller and action.
| Parameter | Description |
|---|---|
| controller | Controller name |
| action | Action name |
Redirect(String area, String controller, String action)
Redirects to another controller and action.
| Parameter | Description |
|---|---|
| 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.
| Parameter | Description |
|---|---|
| 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.
| Parameter | Description |
|---|---|
| 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.
| Parameter | Description |
|---|---|
| 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.
| Parameter | Description |
|---|---|
| area | Area name |
| controller | Controller name |
| action | Action name |
| parameters | Key/value pairings |
ToQueryString(NameValueCollection parameters) : String
Missing summary
| Parameter | Description |
|---|---|
| parameters | Missing documentation |
ToQueryString(IDictionary parameters) : String
Missing summary
| Parameter | Description |
|---|---|
| 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
| Parameter | Description |
|---|---|
| action | Action name |
Send(String action, Object[] actionArgs)
Performs the specified action with arguments.
| Parameter | Description |
|---|---|
| action | Action name |
| actionArgs | Action arguments |
ShouldSkip(MethodInfo method, IDictionary filtersToSkip) : Boolean
Missing summary
| Parameter | Description |
|---|---|
| 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
| Parameter | Description |
|---|---|
| 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.
| Parameter | Description |
|---|---|
| message | The instance of System.Web.Mail.MailMessage that will be sent |
RenderEmailAndSend(String templateName)
Renders and delivers the e-mail message.
| Parameter | Description |
|---|---|
| templateName |
RaiseOnActionExceptionOnExtension()
Missing summary