Author |
Topic |
|
Notion
Starting Member
United Kingdom
14 Posts |
Posted - March 14 2004 : 04:15:52
|
Hello,
I have looked long and hard for an answer to this question on this forum but for what ever reason I can not find one.
What I would like to be able to do is this: Below the shipping method drop down box, I want to include another dropdown box which is in the external file. I have managed to add another table row, but just do not know how to get the contents of the external file to display in the new table row.
This is where the file needs to go:
'Response.write "<td colspan='2'>" EXTERNAL FILE IS DISPLAYED HERE 'Response.write "</td>"
hope someone can help!
|
|
devshb
Senior Member
United Kingdom
1904 Posts |
Posted - March 14 2004 : 04:54:06
|
you should be able to use server-side includes, eg:
Response.write "<td colspan='2'>" %> <!--#include file="yourfile.asp"--> <% Response.write "</td>"
(note that the include is done outside the vbscript, so you need to close+reopen the <% %> tags as above)
you can include html files as well as asps etc
for your new poplist, you can look at the file shopcountries as your base to see how it shows poplists.
shopcountries.asp defines a function which will show a country poplist (and then you just call the function from your page), an alternative is to store just the html code that's inside that function and include it as above.
So, to do what you want, there are 2 main ways:
1) Turn your external file into a function, as per shopcountries, and include that file once per relevant page, and then call it from wherever you want to use it in the vbscript.
2) If you just want to include literal text or html code, you can just include the file as per the example above.
I'd suggest using the same logic as shopcountries, as it'll set the poplist value according to what's been chosen.
If you need a hand getting your poplist integrated, feel free to email me.
Thanks.
Simon Barnaby Freelance Developer Java-E UK [email protected]
Edited by - devshb on March 14 2004 05:08:18 |
|
|
Notion
Starting Member
United Kingdom
14 Posts |
Posted - March 14 2004 : 06:49:27
|
Thanks Simon, that worked just great.
I have read all sorts about including files, to needing a subroutine for it to work, but all I needed was the open and close tags in the right place.
I know very little indeed about ASP so your info is much appreciated.
thanks Colin Clark www.colinclarkart.com
|
|
|
devshb
Senior Member
United Kingdom
1904 Posts |
Posted - March 15 2004 : 03:08:22
|
cool; glad it did what you needed.
Including files (without having to read through 100's of manuals to finally find the key answer that they seem to hide in such manuals in a small obscure paragraph), and finding out how browsers/servers deal with htmls/asps when they're all inter-mingled is a key part of something like vpasp, so I think your question will help a lot of other forum users as well, which is always a good thing.
So, if anyone else has similar include questions/problems, feel free to post them; believe me - you won't be alone in your question!
Simon Barnaby Freelance Developer Java-E UK [email protected] |
|
|
|
Topic |
|