Class ControllerExtensions
Extension methods to help sending back list items from the controllers.
Inherited Members
Namespace: DynamicVML.Extensions
Assembly: DynamicVML.dll
Syntax
public static class ControllerExtensions
Remarks
Please see the sample applications for examples on how they are used.
Methods
| Improve this Doc View SourcePartialView(Controller, IDynamicList, AddNewDynamicItem)
Creates the partial view for the item that should be sent back to the client.
Declaration
public static ActionResult PartialView(this Controller controller, IDynamicList item, AddNewDynamicItem parameters)
Parameters
Type | Name | Description |
---|---|---|
Controller | controller | The controller handling the action for creating the new item. |
IDynamicList | item | The dynamic list item to be rendered. |
AddNewDynamicItem | parameters | The AddNewDynamicItem received by the controller. |
Returns
Type | Description |
---|---|
ActionResult | An ActionResult to be sent back to the client. |
PartialView<TViewModel>(Controller, TViewModel, AddNewDynamicItem)
Creates the partial view for the item that should be sent back to the client.
Declaration
public static ActionResult PartialView<TViewModel>(this Controller controller, TViewModel viewModel, AddNewDynamicItem parameters)
where TViewModel : class
Parameters
Type | Name | Description |
---|---|---|
Controller | controller | The controller handling the action for creating the new item. |
TViewModel | viewModel | The view model whose view should be rendered. |
AddNewDynamicItem | parameters | The AddNewDynamicItem received by the controller. |
Returns
Type | Description |
---|---|
ActionResult | An ActionResult to be sent back to the client. |
Type Parameters
Name | Description |
---|---|
TViewModel | The type of the view model whose view should be rendered. |
PartialView<TViewModel>(Controller, TViewModel, AddNewDynamicItem, Action<DynamicListItem<TViewModel>>)
Renders a partial view containing the item to be in plain HTML, and converts it to JSON so it can be sent back to the client. You should only use this method when using Post.
Declaration
public static ActionResult PartialView<TViewModel>(this Controller controller, TViewModel viewModel, AddNewDynamicItem parameters, Action<DynamicListItem<TViewModel>> options)
where TViewModel : class
Parameters
Type | Name | Description |
---|---|---|
Controller | controller | The controller handling the action for creating the new item. |
TViewModel | viewModel | The view model whose view should be rendered. |
AddNewDynamicItem | parameters | The AddNewDynamicItem received by the controller. |
Action<DynamicListItem<TViewModel>> | options | An action that allows for configuring the options to be associated with the new item before it gets inserted to the list. |
Returns
Type | Description |
---|---|
ActionResult | An ActionResult to be sent back to the client. |
Type Parameters
Name | Description |
---|---|
TViewModel | The type of the view model whose view should be rendered. |
PartialView<TViewModel, TOptions>(Controller, TViewModel, AddNewDynamicItem, TOptions)
Renders a partial view containing the item to be in plain HTML, and converts it to JSON so it can be sent back to the client. You should only use this method when using Post.
Declaration
public static ActionResult PartialView<TViewModel, TOptions>(this Controller controller, TViewModel viewModel, AddNewDynamicItem parameters, TOptions options)
where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new()
Parameters
Type | Name | Description |
---|---|---|
Controller | controller | The controller handling the action for creating the new item. |
TViewModel | viewModel | The view model whose view should be rendered. |
AddNewDynamicItem | parameters | The AddNewDynamicItem received by the controller. |
TOptions | options | Any additional options you might want to specify for this item. |
Returns
Type | Description |
---|---|
ActionResult | An ActionResult to be sent back to the client. |
Type Parameters
Name | Description |
---|---|
TViewModel | The type of the view model whose view should be rendered. |
TOptions | The options associated with the view model. |
PartialView<TViewModel, TOptions>(Controller, TViewModel, AddNewDynamicItem, Action<TOptions>)
Renders a partial view containing the item to be in plain HTML, and converts it to JSON so it can be sent back to the client. You should only use this method when using Post.
Declaration
public static ActionResult PartialView<TViewModel, TOptions>(this Controller controller, TViewModel viewModel, AddNewDynamicItem parameters, Action<TOptions> options)
where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new()
Parameters
Type | Name | Description |
---|---|---|
Controller | controller | The controller handling the action for creating the new item. |
TViewModel | viewModel | The view model whose view should be rendered. |
AddNewDynamicItem | parameters | The AddNewDynamicItem received by the controller. |
Action<TOptions> | options | An action that allows for configuring the options to be associated with the new item before it gets inserted to the list. |
Returns
Type | Description |
---|---|
ActionResult | An ActionResult to be sent back to the client. |
Type Parameters
Name | Description |
---|---|
TViewModel | The type of the view model whose view should be rendered. |
TOptions | The options associated with the view model. |
PartialViewAsync(Controller, ICompositeViewEngine, IDynamicList, AddNewDynamicItem)
Renders a partial view containing the item to be in plain HTML, and converts it to JSON so it can be sent back to the client. You should only use this method when using Post.
Declaration
public static Task<ActionResult> PartialViewAsync(this Controller controller, ICompositeViewEngine engine, IDynamicList item, AddNewDynamicItem parameters)
Parameters
Type | Name | Description |
---|---|---|
Controller | controller | The controller handling the action for creating the new item. |
ICompositeViewEngine | engine | An instance of the ICompositeViewEngine class (which can be obtained using dependency injection by asking it as a new parameter in your controllers' constructor) |
IDynamicList | item | The dynamic list item to be rendered. |
AddNewDynamicItem | parameters | The AddNewDynamicItem received by the controller. |
Returns
Type | Description |
---|---|
Task<ActionResult> | An ActionResult to be sent back to the client. |
PartialViewAsync<TViewModel>(Controller, ICompositeViewEngine, TViewModel, AddNewDynamicItem, Action<DynamicListItem<TViewModel>>)
Renders a partial view containing the item to be in plain HTML, and converts it to JSON so it can be sent back to the client. You should only use this method when using Post.
Declaration
public static Task<ActionResult> PartialViewAsync<TViewModel>(this Controller controller, ICompositeViewEngine engine, TViewModel viewModel, AddNewDynamicItem parameters, Action<DynamicListItem<TViewModel>> options)
where TViewModel : class
Parameters
Type | Name | Description |
---|---|---|
Controller | controller | The controller handling the action for creating the new item. |
ICompositeViewEngine | engine | An instance of the ICompositeViewEngine class (which can be obtained using dependency injection by asking it as a new parameter in your controllers' constructor) |
TViewModel | viewModel | The view model whose view should be rendered. |
AddNewDynamicItem | parameters | The AddNewDynamicItem received by the controller. |
Action<DynamicListItem<TViewModel>> | options | Any additional options you might want to specify for this item. |
Returns
Type | Description |
---|---|
Task<ActionResult> | An ActionResult to be sent back to the client. |
Type Parameters
Name | Description |
---|---|
TViewModel | The type of the view model whose view should be rendered. |
PartialViewAsync<TViewModel, TOptions>(Controller, ICompositeViewEngine, TViewModel, AddNewDynamicItem, TOptions)
Renders a partial view containing the item to be in plain HTML, and converts it to JSON so it can be sent back to the client. You should only use this method when using Post.
Declaration
public static Task<ActionResult> PartialViewAsync<TViewModel, TOptions>(this Controller controller, ICompositeViewEngine engine, TViewModel viewModel, AddNewDynamicItem parameters, TOptions options)
where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new()
Parameters
Type | Name | Description |
---|---|---|
Controller | controller | The controller handling the action for creating the new item. |
ICompositeViewEngine | engine | An instance of the ICompositeViewEngine class (which can be obtained using dependency injection by asking it as a new parameter in your controllers' constructor) |
TViewModel | viewModel | The view model whose view should be rendered. |
AddNewDynamicItem | parameters | The AddNewDynamicItem received by the controller. |
TOptions | options | Any additional options you might want to specify for this item. |
Returns
Type | Description |
---|---|
Task<ActionResult> | An ActionResult to be sent back to the client. |
Type Parameters
Name | Description |
---|---|
TViewModel | The type of the view model whose view should be rendered. |
TOptions | The options associated with the view model. |
PartialViewAsync<TViewModel, TOptions>(Controller, ICompositeViewEngine, TViewModel, AddNewDynamicItem, Action<TOptions>)
Renders a partial view containing the item to be in plain HTML, and converts it to JSON so it can be sent back to the client. You should only use this method when using Post.
Declaration
public static Task<ActionResult> PartialViewAsync<TViewModel, TOptions>(this Controller controller, ICompositeViewEngine engine, TViewModel viewModel, AddNewDynamicItem parameters, Action<TOptions> options)
where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new()
Parameters
Type | Name | Description |
---|---|---|
Controller | controller | The controller handling the action for creating the new item. |
ICompositeViewEngine | engine | An instance of the ICompositeViewEngine class (which can be obtained using dependency injection by asking it as a new parameter in your controllers' constructor) |
TViewModel | viewModel | The view model whose view should be rendered. |
AddNewDynamicItem | parameters | The AddNewDynamicItem received by the controller. |
Action<TOptions> | options | Any additional options you might want to specify for this item. |
Returns
Type | Description |
---|---|
Task<ActionResult> | An ActionResult to be sent back to the client. |
Type Parameters
Name | Description |
---|---|
TViewModel | The type of the view model whose view should be rendered. |
TOptions | The options associated with the view model. |