include file

  • Thread starter Thread starter Matt
  • Start date Start date
M

Matt

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!
 
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
 
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>
 
Back
Top