Creating a Hello World Widget using Sitefinity MVC

Sitefinity widgets can be built using the new support for ASP.NET MVC. The associated video demonstrates how you can build a "Hello, World" style widget using MVC.

Step by Step

  1. Create a new HelloWorldController.cs class file in the folder MVC/Controllers. For an example, see the documentation Creating the controller
  2. Add the ControllerToolbox attribute to your controller class, as described in this article: Adding an MVC widget to the toolbox
  3. Create a folder named HelloWorld in the folder MVC/View so that the naming convention matches your HelloWorldController class. For another example see the documentation article Creating the View
  4. Add the view file Default.cshtml to the folder MVC/View/HelloWorld.
  5. For an example of adding a Model to your widget, see the following article: Creating the Model
  6. Build the project
  7. Create a new page in Sitefinity following the procedure Creating a new page
  8. Add the Hello World widget from the toolbar to the page following the procedure Adding widgets on your page
  9. Publish the page
  10. View the page in a browser, revealing the Hello World widget output.

Next steps

+1-888-365-2779
sales@sitefinity.com
Feedback

How useful is this article?

Tell us more

Submit
Your message was successfully sent.

We appreciate your feedback.

Your message could not be sent.

OK