include file

Discussion in 'ASP .Net' started by Matt, Nov 8, 2003.

  1. Matt

    Matt Guest

    In ASP 3.0, we use <!-- #INCLUDE FILE="anotherfile.asp" -->

    But when I use it in ASP.NET, it failed to compile.

    I heard that I should use <%@ Page, or <%@Reference, but in the header of
    the page. But dont know how.

    please help!
    Matt, Nov 8, 2003
    #1
    1. Advertising

  2. Matt

    aymer Guest

    tis true, there are several methods in asp.net that are
    far more beneficial than the classic include file, but the
    code should still work.

    1. make sure the page ur trying to attach is compilable
    and compatible with the page ur attaching it to. test and
    keep it simple first. like create a test1.aspx file with
    only the word "hello" on it. then, attach it.

    <!-- #INCLUDE FILE="test1.aspx" -->

    2. by the way, u mispelled "anotherfile.asp". it should
    be "anotherfile.aspx" with an "x". but that is probably
    not the issue at hand.

    peace,
    aymer
    aymerb[@]yahoo.com
    aymer, Nov 8, 2003
    #2
    1. Advertising

  3. You should look at user controls, or placeholder controls as a replacement
    for include files. They are fully server scriptable and acan be interacted
    with in all the page events and can be dynamically named and loaded. You
    can still do includes, but its not seem as best practice with the object
    nature of asp.net.

    --
    Regards

    John Timney (Microsoft ASP.NET MVP)
    ----------------------------------------------
    <shameless_author_plug>
    Professional .NET for Java Developers with C#
    ISBN:1-861007-91-4
    Professional Windows Forms
    ISBN: 1861005547
    Professional JSP 2nd Edition
    ISBN: 1861004958
    Professional JSP
    ISBN: 1861003625
    Beginning JSP Web Development
    ISBN: 1861002092
    </shameless_author_plug>
    ----------------------------------------------

    "Matt" <> wrote in message
    news:...
    > In ASP 3.0, we use <!-- #INCLUDE FILE="anotherfile.asp" -->
    >
    > But when I use it in ASP.NET, it failed to compile.
    >
    > I heard that I should use <%@ Page, or <%@Reference, but in the header of
    > the page. But dont know how.
    >
    > please help!
    >
    >
    John Timney \(Microsoft MVP\), Nov 8, 2003
    #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. Victor Bazarov

    #include "file" -vs- #include <file>

    Victor Bazarov, Mar 5, 2005, in forum: C++
    Replies:
    4
    Views:
    525
    Exits Funnel
    Mar 6, 2005
  2. PTM
    Replies:
    1
    Views:
    321
    Andy Dingley
    Nov 12, 2007
  3. naveeddil
    Replies:
    0
    Views:
    553
    naveeddil
    Jan 4, 2008
  4. Andreas Bogenberger
    Replies:
    3
    Views:
    888
    Andreas Bogenberger
    Feb 22, 2008
  5. Eric
    Replies:
    10
    Views:
    449
Loading...

Share This Page