Hello World MVC
Use an MVC application as a CMS function on a page
Now you can use the Home controller from your MVC application on a page as a regular CMS function.
First of all, select where you want your MVC application to appear:
- Log into the CMS Console.
- From the Content perspective, select the page where you want to insert your MVC function.
- Click Edit Page on the toolbar. The page will open in Visual Editor.
Then, insert the MVC function (registered as “Test.SimpleMvc.Home” in this tutorial):
- On the page’s toolbar, click Insert, then Function.
- In the Select Function window, expand All Functions / Test / SimpleMvc and select the Home function.
Figure 3: Selecting the regsitered Mvc function
- Click OK.
The function preview will appear on the edited page.
Figure 4: MVC function preview on an edited page
Finally:
- Save and publish the page.
- In Visual Studio, press F5 to launch the website in the browser and browse to the page. The page will show the contents of your simple MVC application.
Figure 5: The view of the MVC function on a published page