dynamically rendering plain .html page on webmatrix -


i'm trying render .html webpage using @renderpage() method in webmatrix .html extension not supported method. guess method supports cshtml extensions. there way can render html pages dynamically on site (webmatrix). dont want use iframe because i'll have issues jquery files.

i attempted feel safe yet feels unsafe. resolved read html file , inject dom manually using:

array html = null; var mypage = server.mappath(page); if(file.exists(mypage)){     html = file.readalllines(mypage); } 

after reading file.....i injected dom

        <div class="s_content s fontfix left s_content2 downdown">             @foreach (var data in html) {                  <text>@html.raw(data)</text>             }         </div> 

all runs on compilation time before page created rendering.....i attempted security measures attempting inject server-side c# code in html file useless. makes me feel safe atleast. risky? possible threat alternative. wish can still have alternative proper solution house. though.

assuming @renderpage() doesn't support html files, why don't try jquery.load or ajax. there lots of tutorials based on dynamic loading of html content.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -