asp.net - running razor code in html file -
i'm working on on phonegap application. i'm using asp.net project development in , compiling files static html files phonegap app.
i want take advantage of razor syntax things including files , simple logic.
is there way run razor code in html file?
i using cshtml files, phonegap accept html files. have razorengine compile cshtml files html files, need update every link .cshtml .html , things getting complicated.
code example razor templating...
@using system.io; @using razorengine; @{ // render panelhtml , header html once, , print out below in each page string panelhtml = razor.parse(file.readalltext(appdomain.currentdomain.basedirectory + "/views/shared/_panel.cshtml")); string headerhtml = razor.parse(file.readalltext(appdomain.currentdomain.basedirectory + "/views/shared/_headerloggedin.cshtml")); string tophtml = razor.parse(file.readalltext(appdomain.currentdomain.basedirectory + "/views/shared/_headerloggedin.cshtml")); writeliteral(tophtml); } <!-- pagedebug --> <div data-role="page" id="pagedebug" data-add-back-btn="true"> @{ writeliteral(panelhtml); } @{ writeliteral(headerhtml); }
Comments
Post a Comment