Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Web
Expertise: Beginner
Jun 20, 2000

Creating a Drop-Down List File in ASP

Using this tip, you can create a drop-down list, which is populated from a database, and include it in a Web (ASP) page. This will basically increase the performance via the conventional method.

First, you will use a trigger to write to a file whenever the database table is updated. The text in this file will be of type:

 
<select name=x>
  <option value = 1>One</option>
  <option value = 2>Two</option>
  <option value = 3>Three</option>
  .
  .
  . 
</select>
Name this file 'select.inc'.

Then, you will include this file wherever you want a select control to be shown in an ASP page.

 
<TD> 
<% 
<!-- #INCLUDE ="select.inc"-->
%>
</TD>

This will be converted to the following HTML at run-time:

 
<TD> 
<select name=x>
  <option value = 1>One</option>
  <option value = 2>Two</option>
  <option value = 3>Three</option>
  .
  .
  . 
</select>
</TD>
Mujtaba Joad
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date