Razor is mostly HTML
+ C#
. But we need often need .net features, which can vary a bit from .net Framework and DNN, or .net core and Oqtane.
Preprocessor directives such as #if
, #if !
, #else
and #endif
can be used for simple switching of 2-3 lines of code. This is ideal if for example the Request
object has a slightly different signature or if you need to get a list of pages which is different in Dnn and Oqtane.