Skip to content
This repository was archived by the owner on Nov 21, 2022. It is now read-only.

UsingExitStrategyControls

Lodewijk Sioen edited this page Feb 11, 2015 · 2 revisions

Using ExitStrategy: Sharing Mvc views with Webforms pages

ExitStrategy gives you access to your Mvc views on your Webforms pages. There are three controls for this:

Partial Control

You can specify the name of the view with the PartialViewName propery:

<mvc:Partial PartialViewName="Header" runat="server"/>

Editor and Display Control

There controls need three sets of data: a Model, a viewname and additional view data. You can provide these using the following methods:

  • The model: Using standard Webforms Modelbinding. So either use the SelectMethod, a DataSource or the DataSource property.
  • The View: Can be set with the TemplateName property on the control.
  • Additional View Data: By setting the AdditionalViewData propery on the control. You can set this easely with the new expression.

For example:

<mvc:Editor ID="ModelBoundEditor" SelectMethod="GetModel" TemplateName="Table" AdditionalViewData='<%$new: {htmlAttributes = new {@class = "form-control"},} %>' runat="server" />
Clone this wiki locally