For developers: Implement properties in the controller
Widgets would be useless if you could not control their behavior through properties. In the standard WebForms model, properties of the Control class are directly mapped to properties you can set through the widget designer. This is very useful and intuitive, so we’ve also done it for MVC widgets. Every property that you implement in your controller class will be shown in the Widget advanced designer.
We will illustrate this with adding a property called HeaderText, of type string.
[Category(
"General"
)]
public
string
HeaderText
{
get
;
set
;
}
As you can see, we can also specify the category each property appears in. The above property will produce a designer looking similar to the following:

Now we can implement the View to take the value of this property and display it. In order to access the value of this property in the view, we will add it to the ViewData dictionary. This is done in our Action method in the controller.
ViewData[
"HeaderText"
] =
this
.HeaderText;
Then we can use it in our View to display it as a header.
<
h1
>
@ViewData["HeaderText"]
</
h1
>
Once we have completed all this steps, the output of the MVC widget should be rendered correctly.

The “List of features” header is taken from the value we have entered in the widget designer.