Insert string from database into an aspx and have databinding expressions within that text evaluated
- by Christopher Edwards
Well, as you can see I want something quick-and-dirty!
How can I get a string from a db that has aspx databinding syntax in it and have the databinding expressions evaluated?
So I have text such as this stored in the DB:-
Hello <%=User.Name %> I haven't seen you since <%=User.LastVisit %>
And I want it to be inserted here say:-
...
<body>
<form id="form1" runat="server">
<div>
<asp:FormView ID="FormView1" DataSourceID="DataSource1" runat="server">
<ItemTemplate>
<-- insert stuff here! -->
...
But with the databinding expressions evaluated. I'd rather not build a full parsing, templating and evaluation engine...