Using Replace and Server.Execute

P

Phil Grimpo

I have an application where users create pages using a WYSIWYG editor and
the content is stored in the database. For "custom tags" the stored html
will have something like {%Contact_Form%}.

So let's say the html of the page is:
<body>
<html>
This is my form:<br>
{%Contact_Form%}
</html>
<body>

Ok? Then, when the page renders I do this:

<%
RenderedData = rs_Page("MainData")
RenderedData =
Replace(RenderedData,"{%Contact_Form%}",Server.Execute("/IncludedFiles/PageComponents/TESTFORM.asp"))
%>

<%=RenderedData%>


Ok. The problem is this, when the page renders, the contact form is
inserted BEFORE the text where as my original "string" should have had the
form AFTER the text. When I don't use Server.Execute and just replace with
some dummy text or something, everything renders in the appropriate order.
I've done tests where the TESTFORM.asp page just has some text in it and the
same results happens (concluding that it's not a problem with the coding in
that page)

Any ideas on why this isn't rendering in the appropriate order? Shouldn't
the "custom tag" be just simply replace with the html in this included file?

Is there another way to call this file so this works?

thanks for any help.

-Phil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top