Multiple pages pulling form a single text file

Discussion in 'ASP General' started by Matthew Kitchin \(Usenet/Lists\), Jul 9, 2007.

  1. Hello,
    I've got multiple pages on the same server that all have the same drop down
    boxes in them. It is a list of all our facilities. Every time there is a
    change, I have to change it on every page. They are in the format below. Is
    there an easy way to store all that data in a text file so I only have to
    update it one place?

    <option value="fac 1">fac 1</option>
    <option value="fac 2">fac 2</option>
    <option value="fac 3">fac 3</option>

    Thanks,
    Matthew
     
    Matthew Kitchin \(Usenet/Lists\), Jul 9, 2007
    #1
    1. Advertising

  2. Matthew Kitchin (Usenet/Lists) wrote:
    > Hello,
    > I've got multiple pages on the same server that all have the same
    > drop down boxes in them. It is a list of all our facilities. Every
    > time there is a change, I have to change it on every page. They are
    > in the format below. Is there an easy way to store all that data in a
    > text file so I only have to update it one place?
    >
    > <option value="fac 1">fac 1</option>
    > <option value="fac 2">fac 2</option>
    > <option value="fac 3">fac 3</option>
    >
    > Thanks,
    > Matthew

    Sure! Use a #include file.

    Facilities.asp:
    <%
    <option value="fac 1">fac 1</option>
    <option value="fac 2">fac 2</option>
    <option value="fac 3">fac 3</option>
    %>


    PageWithDropdown.asp:

    <select>
    <!--#include file="Facilities.asp" -->
    </select>

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Jul 9, 2007
    #2
    1. Advertising

  3. Gazing into my crystal ball I observed "Matthew Kitchin
    \(Usenet/Lists\)" <> writing in
    news::

    > Hello,
    > I've got multiple pages on the same server that all have the same drop
    > down boxes in them. It is a list of all our facilities. Every time
    > there is a change, I have to change it on every page. They are in the
    > format below. Is there an easy way to store all that data in a text
    > file so I only have to update it one place?
    >
    ><option value="fac 1">fac 1</option>
    ><option value="fac 2">fac 2</option>
    ><option value="fac 3">fac 3</option>
    >
    > Thanks,
    > Matthew
    >
    >


    Put the information in an include file, then include it, eg:

    <select name="whatever" id="whatever">
    <!--#include file="selectoptions_inc.asp"-->
    </select>

    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne Boswell, Jul 11, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve
    Replies:
    12
    Views:
    989
    Steve
    Nov 18, 2005
  2. Replies:
    4
    Views:
    962
    M.E.Farmer
    Feb 13, 2005
  3. Replies:
    2
    Views:
    262
    Ransome
    Jan 11, 2007
  4. Replies:
    17
    Views:
    292
    Tad McClellan
    Mar 10, 2006
  5. ela
    Replies:
    12
    Views:
    355
    Uri Guttman
    Apr 6, 2009
Loading...

Share This Page