Simon's solution sounds good. I also have an untested JavaScript trick
for this from RedDot UK, which puts the placeholder content inside a
JavaScript comment inside a JavaScript function, and uses
function.toString() to get at the function's source code and a regular
expression to extract it from the comment. Very clever, if it works -
looking at it I can't believe that you can call a JavaScript function
from inside ASP, but I've never used runat="server" before. Simon's
solution is cleaner as long as the change doesn't have any unwanted
side-effects.
<script language="JScript" runat="server">
function get_placeholder(name) {
var re = /\/\*((?:.|\n)*)\*\//;
return re.exec(eval("var_" + name + ".toString()"))[1];
}
function var_txt_content() {
/*<%txt_content%>*/
}
</script>
<%
txt_content = get_placeholder("txt_content")
%>