Using Replace and Server.Execute

Discussion in 'ASP General' started by Phil Grimpo, Feb 2, 2005.

  1. Phil Grimpo

    Phil Grimpo Guest

    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
    Phil Grimpo, Feb 2, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Adrian Bezzina
    Replies:
    0
    Views:
    506
    Adrian Bezzina
    Aug 7, 2003
  2. Alun
    Replies:
    3
    Views:
    4,475
    Masudur
    Feb 18, 2008
  3. Savas Ates
    Replies:
    1
    Views:
    268
    Patrice
    Aug 17, 2004
  4. Phil Grimpo

    Using Replace and Server.Execute

    Phil Grimpo, Feb 2, 2005, in forum: ASP General
    Replies:
    0
    Views:
    63
    Phil Grimpo
    Feb 2, 2005
  5. mscir
    Replies:
    0
    Views:
    296
    mscir
    Oct 12, 2005
Loading...

Share This Page