Razor Basics

  1. Change all base classes of Razor to Custom.Hybrid.Razor12
  2. Change all .cs files which need context to inherit Custom.Hybrid.Code12
  3. Change @RenderPage to @Html.Partial
    1. To get values in the sub-page, use DynamicModel.property, not PageData["property"]
  4. ...

Remove all inline or external @helper sections

The @helper isn't supported in Razor. If you have them in the primary file, just replace with a function.

  1. Replace all helpers to be functions returning dynamic.
    1. Put into a @functions { } block
  2. Build the content using RazorBlade with Tag.Div(...) and similar. To return a complex html which was a string first, put it into Tag.Custom(string). 

If you have a .cshtml library, you will...

  • either split the library into many .cshtml files
  • or create a .cs shared class with functions (Oqtane doesn't support .cshtml as code)

Koi

  1. Change all cases of Koi to use GetService<Connect.Koi.ICss>() instead of the global static object. See example in content-app.
  2. Replace the KOI warnings to use the texts stored in Koi (see content-app)

Dnn Object and DotNetNuke Namespace

  1. Convert everything

Activate JS

Including JS works just like before, but starting it is different. Make sure your code differentiates between general init functions (which should run automatically once on $(...) and code which activates HTML - which should be a function and called from Html once ready. See examples in fancybox and content-app. 

  1. Reorg code
  2. Ensure primary init happens automatically
  3. Ensure activation is a function called by the page
  4. Make sure that if activation is called multiple times, it doesn't break stuff 
  5. Anything that uses animations must be tested against Oqtane, as it only has jQuery slim and may need some monkey-patching

Special Cases

  1. In some Razors we're still returning a file - like an RSS xml or something. This must be moved to a WebApi and linked to using Link.Api(path: "api/rss?id=") or similar