Results 1 to 7 of 7

Thread: Calling ASP into Webpage

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Posts
    492

    Calling ASP into Webpage

    I have created an ASP page that retreives some data from a db. Now i have a webpage where i would like to call the asp page so that it can display the stuff that it retrieves on my webpage. How do i do this.

    Please provide code.

  2. #2
    Addicted Member
    Join Date
    Nov 2001
    Location
    Yewston, Texis
    Posts
    240
    Let's say you have a webpage called myform.html and an asp called fetch.asp. Here's what myform.html might look like:

    <html><head><title>myform</title></head>
    <body>
    <form method="post" action="fetch.asp">
    <input type="submit" value="Get It">
    </form>
    </body>
    </html>

    cudabean

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Posts
    492
    Your code is great but it wasnt exactly what i was looking for. What i mean was that whatever is on fetch.asp shall show up on myform.html page at load time. No after clicking the Get it button.

    Thanks for the help anyway.

  4. #4
    Addicted Member
    Join Date
    Nov 2001
    Location
    Yewston, Texis
    Posts
    240
    In that case, the best approach is to modify the fetch.asp so that it outputs html including the data that it fetched. In other words, you call fetch.asp, it does the db select and writes out it's own HTML.

    An alternate approach, if you wish to retain the two files would be to specify a body tag where you specifiy an onLoad event which directs the fetch.asp output to run in an embedded iframe named output, but this is getting more complicated and unneccessary for what you seem to be asking for:

    <body onLoad="output.location.href('fetch.asp');">
    <iframe id="output"></iframe>
    </body>

    cudabean

  5. #5
    Fanatic Member ubunreal69's Avatar
    Join Date
    Apr 2001
    Location
    Morayfield, Australia
    Posts
    609
    mrstuff68, you seem to be interested in ASP, i onced used it and was somewhat more advanced than you before i gave it up to persue PHP.

    there is a great tutorial by Manas Tungare here: http://www.manastungare.com i highly reccomend reading it.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Posts
    492
    Cudabean, well we are getting closer to what i want, but not there yet, so let me try to explain it another way.

    Think of my webpage as a big table. And in one of the fields i want to display the info that i get from the asp page.

    Here is what i am talking about, i am going to draw a graphic for you.

    ------------------------------------------------------------------
    | | My Webpage Title |
    ------------------------------------------------------------------
    | Date |Stuff |
    ------------------------------------------------------------------
    |Graphic |More Stuff |
    ------------------------------------------------------------------
    | |Display ASP here |
    -------------------------------------------------------------------
    | | |
    -------------------------------------------------------------------
    etc...


    So where it says Display ASP here, is where i want the contents of the ASP file to display.

    The asp page output looks like this, it has 1 field being displayed.
    ---------------------------------------
    | Info from DB |
    ---------------------------------------
    I would like to get that info into the Display ASP here.

    In other words the last piece of code you gave me was in like a little window on the screen, i dont want the window i just want the stuff inside of the window on the screen.

    Thanks for you help.

  7. #7
    Addicted Member
    Join Date
    Nov 2001
    Location
    Yewston, Texis
    Posts
    240
    OK,

    For the ASP use this BODY tag:

    <BODY ID="myBody" STYLE="border: none;">

    It turns off the border inset. It also gives your body a name of myBody. (you probably don't need to name it, it's only if you have some JavaScript variables that you need to access from external JavaScript commands.)

    Now, on the main page, you can specify the size in pixels that your <iframe> is. So just as before except with a modified iframe:

    <body onLoad="output.location.href('fetch.asp');">
    <!-- content -->
    <iframe id="output" width=600 height=410></iframe>
    <!-- more content -->
    </body>

    cudabean

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width