|
-
May 13th, 2002, 06:50 PM
#1
Thread Starter
Hyperactive Member
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.
-
May 13th, 2002, 10:41 PM
#2
Addicted Member
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
-
May 13th, 2002, 10:51 PM
#3
Thread Starter
Hyperactive Member
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.
-
May 14th, 2002, 12:24 AM
#4
Addicted Member
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
-
May 14th, 2002, 07:36 AM
#5
Fanatic Member
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.
-
May 14th, 2002, 08:38 AM
#6
Thread Starter
Hyperactive Member
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.
-
May 15th, 2002, 11:41 PM
#7
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|