[please don't top-post]
protected string StaticFunction()
{
return "50";
}
I read that as...
Response.Write("<td width='<%= StaticFunction() %>' />")
though I could be wrong...
You are. The equals sign is shorthand for Response.Write and is used to
inject server-side content into client-side markup - that's what <%...%>
is for.
If that is the case, then add to what Alexy wrote...
Response.Write("<td width='" + StaticFunction() + "' />")
That is server-side code which is trying to inject additional characters
into the HTML stream, and should be avoided at all costs. ASP.NET is
object-orentated, not liner like ASP, and you often have very little
control over where the characters you are injecting will actually end up.
However, this problem doesn't exist in the way Alexey demonstrated because
the injected characters can only appear between the <%...%> tags.