How to Add a new SPAView to a SPAModule?

  1. Right click on the folder of the SPAModule you would like to add the SPAView to, and and choose new item.
  2. In the Visual Studio wizard select SPAView and insert the name of your SPAView.
  3. If needed you may change the default routing rules for locating your SPAView within the module by modifying the module definition files Main.cshtml, and Mainjs,cshtml, otherwise no futher action is needed.The default routing rule maps a view name of the type MyView into the MyView.cshtml template definition and into the MyViewJs.cshtml AMD dynamic JavaScript file, and maps a prefixed view name like Logged/MyView into the Logged_MyView.cshtml template definition and into the Logged_MyViewJs.cshtml AMD dynamic JavaScript file.
  4. Defiine the Javascript code of your SPAView in the <SPAView Name>Js.cshtml file, and its template in the <SPAView Name>.cshtml file.
This step by step video tutorial, and this tutorial may help.

Feedback and Knowledge Base