Sunday 15 July 2012

asp.net - render .htm page into .aspx page -


<. Html>

In my .aspx page, I want to render a .htm page that has some data in .aspx page: < / P>

  & lt;% HTML.RenderPartial ("/ view / template / HTML_Temp.htm"); & Gt%;  

but it returns a runtime error:

Server error in the '/' application

No Build Provider Registered for Extension 'htm' You can register one in the machine.config or section in web.config. Ensure that there is a BuildProviderAppliesToAttribute attribute in which the value is 'web' or 'all'

How to solve this problem ... please

Try instead:

& lt;% = file. Read all text (server.MapPath ("/ visual / template / HTML_Temp.htm"))%>


No comments:

Post a Comment