Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default include files

    Hi all,

    I used to use the include statement in classic asp to centralise my database
    connection, is there a better way in asp.net, whats the norm?.

    Thanks alot


    Neil


    Neil Steventon Guest

  2. Similar Questions and Discussions

    1. editing include files
      Can you explain in more detail how you got includes to work using Cold Fusion and Contribute. I've found that they don't display correctly in edit...
    2. how do I hide database connection files using PHP include files?
      I have the following at the beginning of the PHP page: <?php require_once('Connections/conn.php'); ?> I want to hide the connection file,...
    3. Include files in .NET
      Hi, Does anyone know the syntax to include a .js file in an ASPX page. Colm
    4. Include Files Dynamically
      Hey there ! I made my own WebControl, that inherits from WebControls, and i added an HtmlTable to it. I would like to include a file,...
    5. DM MX and Include files
      We recently converted from MS Interdev to DW MX and I have copied the files for our existing site into a local site in DW. Most of our pages have SSI...
  3. #2

    Default Re: include files

    u can do it as before in ASP.NET


    "Neil Steventon" <neil.steventon@qualtronyc.co.uk> дÈëÏûÏ¢ÐÂÎÅ
    :vgnlt9t0ad0ub0@corp.supernews.com...
    > Hi all,
    >
    > I used to use the include statement in classic asp to centralise my
    database
    > connection, is there a better way in asp.net, whats the norm?.
    >
    > Thanks alot
    >
    >
    > Neil
    >
    >

    Yangtsi River Guest

  4. #3

    Default Re: include files

    neil,

    use web.config to store your db connection string...

    HTH


    "Neil Steventon" <neil.steventon@qualtronyc.co.uk> wrote in message
    news:vgnlt9t0ad0ub0@corp.supernews.com...
    > Hi all,
    >
    > I used to use the include statement in classic asp to centralise my
    database
    > connection, is there a better way in asp.net, whats the norm?.
    >
    > Thanks alot
    >
    >
    > Neil
    >
    >

    Kerberoz Guest

  5. #4

    Default Re: include files

    does asp.net support include files ?

    MN

    "Kerberoz" <dec698@hotmail.com> wrote in message
    news:ucHtMhfRDHA.3192@TK2MSFTNGP10.phx.gbl...
    > neil,
    >
    > use web.config to store your db connection string...
    >
    > HTH
    >
    >
    > "Neil Steventon" <neil.steventon@qualtronyc.co.uk> wrote in message
    > news:vgnlt9t0ad0ub0@corp.supernews.com...
    > > Hi all,
    > >
    > > I used to use the include statement in classic asp to centralise my
    > database
    > > connection, is there a better way in asp.net, whats the norm?.
    > >
    > > Thanks alot
    > >
    > >
    > > Neil
    > >
    > >
    >
    >

    MN Guest

  6. #5

    Default Re: include files

    does asp.net support include files ?

    MN

    "Kerberoz" <dec698@hotmail.com> wrote in message
    news:ucHtMhfRDHA.3192@TK2MSFTNGP10.phx.gbl...
    > neil,
    >
    > use web.config to store your db connection string...
    >
    > HTH
    >
    >
    > "Neil Steventon" <neil.steventon@qualtronyc.co.uk> wrote in message
    > news:vgnlt9t0ad0ub0@corp.supernews.com...
    > > Hi all,
    > >
    > > I used to use the include statement in classic asp to centralise my
    > database
    > > connection, is there a better way in asp.net, whats the norm?.
    > >
    > > Thanks alot
    > >
    > >
    > > Neil
    > >
    > >
    >
    >



    MN Guest

  7. #6

    Default Re: include files

    ASP.Net has support for include files. However, the support is there mostly
    for backwards-compatibility, and you should avoid using server-side
    includes. The problem is that ASP is procedural in nature, and therefore, an
    include file is processed in the position in the page script where it is
    included. ASP.Net, however, is object-oriented, and your code is not
    executed in the order in which it appears in the page. Objects are
    instantiated, and their methods are called, and each object renders itself
    in the page. This means that using an include file is not only NOT
    object-oriented, but the results of including it can be not at all what you
    might expect. Instead, try to stick with using object-oriented principles
    and methods in your coding.

    --
    HTH,

    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    [url]http://www.takempis.com[/url]
    Big things are made up
    of lots of little things

    "MN" <ngpvivek@yahoo.com> wrote in message
    news:uUVKdvfRDHA.3880@tk2msftngp13.phx.gbl...
    > does asp.net support include files ?
    >
    > MN
    >
    > "Kerberoz" <dec698@hotmail.com> wrote in message
    > news:ucHtMhfRDHA.3192@TK2MSFTNGP10.phx.gbl...
    > > neil,
    > >
    > > use web.config to store your db connection string...
    > >
    > > HTH
    > >
    > >
    > > "Neil Steventon" <neil.steventon@qualtronyc.co.uk> wrote in message
    > > news:vgnlt9t0ad0ub0@corp.supernews.com...
    > > > Hi all,
    > > >
    > > > I used to use the include statement in classic asp to centralise my
    > > database
    > > > connection, is there a better way in asp.net, whats the norm?.
    > > >
    > > > Thanks alot
    > > >
    > > >
    > > > Neil
    > > >
    > > >
    > >
    > >
    >
    >
    >
    >

    Kevin Spencer Guest

  8. #7

    Default Re: Include files

    The most common approach is to replace include files with web user controls.
    They basically are like object oriented include files on steroids.

    Here's more info:
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconintroductiontowebusercontrols.asp[/url]
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vboriwebusercontrols.asp[/url]
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconWebUserControlsVsCustomWebControls.asp[/url]

    --
    I hope this helps,
    Steve C. Orr, MCSD
    [url]http://Steve.Orr.net[/url]


    "Michael Tissington" <michael@nospam.com> wrote in message
    news:egWp3xaSDHA.1684@TK2MSFTNGP11.phx.gbl...
    > I have a web project that has a bunch of include (.inc files)
    > In my aspx I have something like
    >
    > <!-- #include file = ..... ->
    >
    > In a single aspx I might have a number of these inc and basically I'm
    using
    > them to avoid retyping a bunch of common html.
    >
    > For example I have a header.inc which I put inside the <head> tag and the
    > inc file has information about style sheets and javascript files that I
    > load.
    >
    > What is a better way of doing this that does not use inc files.
    >
    > Basically I have a bunch of common html that I need to include in
    different
    > apsx files.
    >
    > Thanks.
    >
    > --
    > Michael Tissington
    > Oaklodge Technologies
    > [url]http://www.oaklodge.com/technology[/url]
    >
    >
    >

    Steve C. Orr, MCSD Guest

  9. #8

    Default Re: Include files

    Thanks

    --
    Michael Tissington
    Oaklodge Technologies
    [url]http://www.oaklodge.com/technology[/url]

    "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
    news:%23NcEf2aSDHA.2252@TK2MSFTNGP12.phx.gbl...
    > The most common approach is to replace include files with web user
    controls.
    > They basically are like object oriented include files on steroids.
    >
    > Here's more info:
    >
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconintroductiontowebusercontrols.asp[/url]
    >
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vboriwebusercontrols.asp[/url]
    >
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconWebUserControlsVsCustomWebControls.asp[/url]
    >
    > --
    > I hope this helps,
    > Steve C. Orr, MCSD
    > [url]http://Steve.Orr.net[/url]
    >
    >
    > "Michael Tissington" <michael@nospam.com> wrote in message
    > news:egWp3xaSDHA.1684@TK2MSFTNGP11.phx.gbl...
    > > I have a web project that has a bunch of include (.inc files)
    > > In my aspx I have something like
    > >
    > > <!-- #include file = ..... ->
    > >
    > > In a single aspx I might have a number of these inc and basically I'm
    > using
    > > them to avoid retyping a bunch of common html.
    > >
    > > For example I have a header.inc which I put inside the <head> tag and
    the
    > > inc file has information about style sheets and javascript files that I
    > > load.
    > >
    > > What is a better way of doing this that does not use inc files.
    > >
    > > Basically I have a bunch of common html that I need to include in
    > different
    > > apsx files.
    > >
    > > Thanks.
    > >
    > > --
    > > Michael Tissington
    > > Oaklodge Technologies
    > > [url]http://www.oaklodge.com/technology[/url]
    > >
    > >
    > >
    >
    >

    Michael Tissington Guest

  10. #9

    Default Re: Include files

    Hi Michael,

    Here is another article that might help also:
    [url]http://www.xefteri.com/articles/23dec2002/[/url]

    Mike Clay, MCSD
    ASP.Net Developer Support


    This posting is provided "AS IS" with no warranties, and confers no rights.
    © 2002 Microsoft Corporation. All rights reserved.

    Mike Clay Guest

Posting Permissions

  • You may not post new threads
  • You may 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