Professional Web Applications Themes

ASP Include - ASP.NET General

At one time, I developed using ASP and VBScript, and I could use an include directive to include the contents of one file in the server response to the client. I have found that I can do this with asp.net as well, except that whenever I do, I get the error message "There can only be one 'page' directive." I can work around that by simply removing the page directive from the file being included, but I was hoping to be able to use two aspx files, complete with all their code-workings and everything. Any suggestions? Is there a new, ...

  1. #1

    Default ASP Include

    At one time, I developed using ASP and VBScript, and I could use an
    include directive to include the contents of one file in the server
    response to the client. I have found that I can do this with asp.net as
    well, except that whenever I do, I get the error message "There can only
    be one 'page' directive." I can work around that by simply removing the
    page directive from the file being included, but I was hoping to be able
    to use two aspx files, complete with all their code-workings and
    everything. Any suggestions? Is there a new, ASP.NET tid bit of code
    that I can use to do this? I'm using ASP.NET 2003 with Visual Basic
    pages, by the way.

    Thanks.

    Joseph Beard

    Joseph Guest

  2. #2

    Default Re: ASP Include

    Don't use ASP-style includes. Instead, create User Controls, and add them to
    your page.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    The more I learn, the less I know.

    "Joseph Beard" <rr.com> wrote in message
    news:phx.gbl... 


    Kevin Guest

  3. #3

    Default Re: ASP Include

    The concept of "User Controls" have replaced include files.. So let's say
    you wanted to always include a "For Internal Use Only" at the bottom of
    every page, right? Well, make a user control called "Disclaimer.ascx" - and
    put that at the bottom of every page..


    "Joseph Beard" <rr.com> wrote in message
    news:phx.gbl... 


    Frank Guest

Similar Threads

  1. Replies: 4
    Last Post: May 13th, 12:11 PM
  2. proper way to include constants; as module or include file?
    By David Tiberio in forum PERL Modules
    Replies: 2
    Last Post: October 26th, 12:49 AM
  3. Replies: 13
    Last Post: February 25th, 07:30 PM
  4. Replies: 0
    Last Post: November 15th, 06:39 PM
  5. Replies: 0
    Last Post: November 15th, 12:52 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139