I have html strings stored in a database. These are labels and input fields but they also have aspx code in them. You know the nasty <%=%> stuff. In the view I use HtmlDecode(databaseString) on it and it renders the pure html but treats the aspx code as strings. Is there anyway that in the view this can be treated as aspx code?
This is basically a dynamic input form generator where we can define fields and then structure them into different forms for users to fill out. This helps us make it data driven instead of changing the code each time.
View example:
<% var incidentFields = (List<string>)ViewData["InputFields"]; %>
<%foreach(var fields in incidentFields){%>
<%=System.Web.HttpUtility.HtmlDecode(fields) %>
<%}%>
The result: