Results 1 to 7 of 7

Thread: #include

  1. #1

    Thread Starter
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336

    #include

    Hi, How come my INCLUDE statements are just rpinting on the page as text instead of actually including the file?

    <--#INCLUDE VIRTUAL="topnav.htm"-->
    <--#INCLUDE VIRTUAL="sidenav.htm"-->

    it just prints that as text. I have it in an aspx file.

    Example code.

    VB Code:
    1. <%@ Page CodeBehind="specialeventinfo.aspx.vb" Language="vb" AutoEventWireup="false" Inherits="OptimaBackEndTest.specialeventinfo" %>
    2. <--#INCLUDE VIRTUAL="topnav.htm"-->
    3. <--#INCLUDE VIRTUAL="sidenav.htm"-->
    4. <script language="JavaScript">
    5. <!--
    6. function Validate(){ //v2.0
    7. if(document.form.txtEventTitle.value == "" || document.form.txtFeatureText.value == ""){
    8. alert("All fields must be filled in.");
    9. }
    10. }
    11.  
    12. function MoveVars() { //v2.0
    13. var title = document.form.txtEventTitle.value;
    14. var info = document.form.txtEventInfo.value;
    15. document.form2.PreTitle.value =title;
    16. document.form2.PreInfo.value  =info;
    17. }
    18. //-->
    19. </script>
    20. <td valign="top">
    21.     <table width="549" height="97" border="0" cellpadding="10" cellspacing="2">
    22.         <tr>

    thanks!
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  2. #2
    Lively Member
    Join Date
    Jan 2001
    Location
    Worcester, MA
    Posts
    77
    <!-- #Include File="file.htm" --> should work
    "Find all you need in your mind if you take the time" -DT

  3. #3

    Thread Starter
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    Nope deosnt work.. same thing.
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  4. #4
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Go to this link and scroll down to this section:

    Include files with ASP.NET: enter User Controls

    http://www.xefteri.com/articles/23dec2002/default.aspx

  5. #5

    Thread Starter
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    thats intersting hells, but it doesn't solve my problem. Should not my includes work?
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  6. #6
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    I have no idea if they are supported in aspx files...
    But your syntax seems to be wrong:
    You have:
    <--#INCLUDE VIRTUAL="topnav.htm"-->

    I think it should be:
    <!-- #include virtual="topnav.htm"-->

  7. #7

    Thread Starter
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    Yep that was it.. My book and Cin0s both posted the ! and i didnt see it either time haha... thanks!
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width