Why does calling page.RenderControl not evaulate <% Response.Write("foo") %>
but it does evaluate <%= "bar" %>
? Is there something else I should be calling instead?
I was under the impression that <%= %>
was shorthand for Response.Write
as it is in classic ASP.
... <p><%= "foo" %><% Response.Write("bar"); %></p> ...
Render Control code...
string output;
using (var mem = new StringWriter())
using (var writer = new XhtmlTextWriter(mem))
{
page.RenderControl(writer);
output = mem.GetStringBuilder().ToString();
}
Outputs...
Expected: "<p>foobar</p>"
Actual: "<p>foo</p>"