Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 1st, 2004, 06:35 AM
Authorized User
 
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Pharasite Send a message via Yahoo to Pharasite
Default ASP Page within ASP Page display

Is it possible to load an external ASP page into an existing one. I've tried using FileSystemObject and Server.Execute, but it shows the data contained in page2 in either the wrong place (filesystemobject) or outside of the table (server.execute).

the reason i have this is because i have a table generated from a database, and each product has it's own description. i want to load let's say "01.asp" for product1 and "02.asp" for product2.

I have the following in my code:

"<table + properties>"
While not objRS.EOF
<tr>
<td>description here</td>
</tr>
objRS.MoveNext
Wend
"</table>"

description here should house the "external asp" pages. is it possible to do that or not?



michael j hemmington
__________________
michael j hemmington
 
Old July 1st, 2004, 06:49 AM
Authorized User
 
Join Date: Jun 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Humm use Include or script method...


<script src="/public/scripts/unistats.php" language=PHP></script>



Stay Beautiful,
Abdul Salam
 
Old July 1st, 2004, 07:29 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Abdul, you are showing a PHP method for doing this. Pharasite wishes for ASP.

Try using a server-side include.

HTH,

Snib

<><
 
Old July 1st, 2004, 08:37 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Michael,

Could you post the code that you use in "01.asp"? That should be useful to know what you are trying to exactly.

Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old July 2nd, 2004, 02:20 AM
Authorized User
 
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Pharasite Send a message via Yahoo to Pharasite
Default

    <%
        Dim objFSO, listFile, followPath

        objConn.Open strConnec
        objRS.Open "Products", objConn, adOpenStatic, adLockReadOnly, adCmdTable
        objRS.Filter= "Prod_Code LIKE '%CR21%'"
    %>
        <table border="0" cellpadding="0" cellspacing="0">
    <%
        While Not objRS.EOF
    %>
            <tr>
                <td width="223px" height="147px">
                    <table border="0" cellpadding="0" cellspacing="0" width="223px" height="147px">
                        <tr>
                            <td width="5" height="120">&nbsp;</td>
                            <td colspan="2" width="213" valign="middle" align="center"><img src="prod-bin/creative/images/2.1/<%=objRS("Prod_Image")%>.png"></td>
                            <td width="5">&nbsp;</td>
                        </tr>
                        <tr>
                            <td colspan="2" width="106" height="27px" align="center"><strong>R</strong>&nbsp;<%=objRS("Prod_Price")%></td>
                            <td colspan="2" width="106" align="center"><img src="images/AtCart.png"></td>
                        </tr>
                    </table>
                </td>
                <td width="348px">
                    <div id="description" style="position: inherit; width: 348px; height: 147px; z-index: inherit; background-color: #FFFFFF">

<--- This is were i would like to loop out the specific page that the While-Wend statement loops out --->
                    </div>
                </td>
            </tr>
    <%
        objRS.MoveNext
        Wend

        objRS.Close
        objConn.Close

        Set objRS = Nothing
        Set objConn = Nothing
    %>

michael j hemmington
 
Old July 3rd, 2004, 06:18 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Actually I was looking for the code that you use in the "description here" area, the one that you feel differs from product to product. In what ways that description differs? And why can you adapt that in one such file thatn going for a file each for different product?

Can you explain more on that and post some code from there too?

Also I would suggest that you use SELECT statement than using a filter there.

Code:
objConn.Open strConnec
objRS.Open "Select * from Products where Prod_Code LIKE '%CR21%'", objConn, adOpenStatic, adLockReadOnly
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old July 5th, 2004, 02:13 AM
Authorized User
 
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Pharasite Send a message via Yahoo to Pharasite
Default

You mean the code the following ...

<%
  Dim objFSO, listFile, ePath

  ePath = Server.MapPath("products/desc/" & objRS("Desc") & ".asp") 'I want this to loop out the correct page to display
  Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
  Set listFile = objFSO.OpenTextFile(ePath,1,FALSE)
  Do While Not listFile.AtEndOfStream
    Response.Write(listFile.ReadLine)
    Response.Write("<br>")
  Loop
  'Close and Set = Nothing
%>

This is the code that should come in by the part I referred to as <--- This is were i would like to loop out the specific page that the While-Wend statement loops out --->, in the above mentioned code.

michael j hemmington
 
Old July 5th, 2004, 12:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Michael,

You may have a look at this article

Dynamic Includes

Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old July 23rd, 2004, 06:57 AM
Registered User
 
Join Date: Jul 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi!

It is possible to include an ASP-page into another one. Use the IFRAME HTML-tag. Se example below:

<IFRAME id="previewframe" width="205" height="105" src="Preview.asp"></IFRAME>

Of course you have to set the src-attribute dynamically on the fly to the correct page...but that shouldn't be a problem. And of course surround the tag with the usual TABLE/TR/TD-tags that makes it fit into your page the way you want it to.

Bjorn







Similar Threads
Thread Thread Starter Forum Replies Last Post
access C#.Net page as action of calssic ASP page mansharma_s ASP.NET 1.x and 2.0 Application Design 6 January 7th, 2008 10:58 AM
Time & date insert and display in myql/asp page karib MySQL 3 June 30th, 2004 05:29 AM
passing values from ASP page to a popup ASP Page astrosmurfboy Classic ASP Basics 3 April 21st, 2004 08:17 PM
ASP Page Doesn't Display stef Classic ASP Databases 1 July 24th, 2003 04:15 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.