Hi,
I was wondering if there was a way to 'include' text used with the <select> tag in ASP. I found that if I included an "include file" reference at the location in the ASP page I want to insert the text I would get what I wanted. BUT, is it good programming or is there a more appropriate way to do what I need done.
I will over simplify my example and hopefully illicit some great threads!
The problem:
Several <select> statements use the same <option>s. I'd like to have those in an external file and reference them when I need them. It'd make the ASP page MUCH less cluttered.
The setup:
'option' file
option.asp
-------start-------------
<%%>
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
<%%>
--------end--------------
form.asp
-------start-------------
<html>
<body>
...<select size="1" name="option1">
......<!--#include file="option.asp"-->
...</select>
...<select size="1" name="option2">
......<!--#include file="option.asp"-->
...</select>
...<select size="1" name="option3">
......<!--#include file="option.asp"-->
...</select>
</body>
</html>
--------end--------------
So, again, I have simply taken a LONG list of options and using the include file feature shortened the creation of certain forms. My testing works so far, but is it the correct way to do this or is this a major kludge?
I was wondering if there was a way to 'include' text used with the <select> tag in ASP. I found that if I included an "include file" reference at the location in the ASP page I want to insert the text I would get what I wanted. BUT, is it good programming or is there a more appropriate way to do what I need done.
I will over simplify my example and hopefully illicit some great threads!
The problem:
Several <select> statements use the same <option>s. I'd like to have those in an external file and reference them when I need them. It'd make the ASP page MUCH less cluttered.
The setup:
'option' file
option.asp
-------start-------------
<%%>
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
<%%>
--------end--------------
form.asp
-------start-------------
<html>
<body>
...<select size="1" name="option1">
......<!--#include file="option.asp"-->
...</select>
...<select size="1" name="option2">
......<!--#include file="option.asp"-->
...</select>
...<select size="1" name="option3">
......<!--#include file="option.asp"-->
...</select>
</body>
</html>
--------end--------------
So, again, I have simply taken a LONG list of options and using the include file feature shortened the creation of certain forms. My testing works so far, but is it the correct way to do this or is this a major kludge?