Is there an '<!--#include...' directive in .NET?

Discussion in 'ASP .Net' started by =?Utf-8?B?bGl0dGxlY2hhcnZh?=, May 11, 2004.

  1. Hi

    I'm trying to write a webpage in ASP.NET using code behind. My code behind page works fine, but now I want to create an instance of an object who's class is stored in a different file. In ASP I've have just used the old <!--#include virtual="file.asp"-->, surely there's something similar I can use in my .cs file

    BTW, I'm not using Visual Studio

    Cheers

    littlecharva
     
    =?Utf-8?B?bGl0dGxlY2hhcnZh?=, May 11, 2004
    #1
    1. Advertisements

  2. =?Utf-8?B?bGl0dGxlY2hhcnZh?=

    avnrao Guest

    User Controls in .Net are similar to #include in asp. try converting your
    code behind and html content to a user control.
    check this article :
    http://support.microsoft.com/default.aspx?scid=kb;en-us;319100&Product=aspnet

    Av.

    "littlecharva" <> wrote in message
    news:...
    > Hi,
    >
    > I'm trying to write a webpage in ASP.NET using code behind. My code
    > behind page works fine, but now I want to create an instance of an object
    > who's class is stored in a different file. In ASP I've have just used the
    > old <!--#include virtual="file.asp"-->, surely there's something similar I
    > can use in my .cs file?
    >
    > BTW, I'm not using Visual Studio.
    >
    > Cheers,
    >
    > littlecharva
     
    avnrao, May 11, 2004
    #2
    1. Advertisements

  3. Another article on User Controls that I'd encourage you to read is:

    An Extensive Examination of User Controls
    http://msdn.microsoft.com/asp.net/u...l=/library/en-us/dnaspp/html/usercontrols.asp

    Happy Programming!


    avnrao wrote:
    > User Controls in .Net are similar to #include in asp. try converting your
    > code behind and html content to a user control.
    > check this article :
    > http://support.microsoft.com/default.aspx?scid=kb;en-us;319100&Product=aspnet
    >
    > Av.
    >
    > "littlecharva" <> wrote in message
    > news:...
    >
    >>Hi,
    >>
    >>I'm trying to write a webpage in ASP.NET using code behind. My code
    >>behind page works fine, but now I want to create an instance of an object
    >>who's class is stored in a different file. In ASP I've have just used the
    >>old <!--#include virtual="file.asp"-->, surely there's something similar I
    >>can use in my .cs file?
    >>
    >>BTW, I'm not using Visual Studio.
    >>
    >>Cheers,
    >>
    >>littlecharva

    >
    >
    >



    --

    Scott Mitchell

    http://www.4GuysFromRolla.com
    http://www.ASPFAQs.com
    http://www.ASPMessageboard.com

    * When you think ASP, think 4GuysFromRolla.com!
     
    Scott Mitchell [MVP], May 11, 2004
    #3
  4. =?Utf-8?B?bGl0dGxlY2hhcnZh?=

    Hans Kesting Guest

    "Ben" <> wrote in message news:...
    > If you're just instantiating a class, you don't need to physically reference a file as long as the file that class is in is also

    in the same project as your web page. Once compiled, you can create an instance of that class in any of your web pages.

    It *is* possible to use classes from different projects: you need to add a "reference" to your *project*
    (not to the specific aspx/ascx)
    this reference can point to the project that contains the classes you want to use
    (if that project is in the same solution) or to the physical dll that contains those classes.

    Hans Kesting
     
    Hans Kesting, May 12, 2004
    #4
    1. Advertisements

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. Farooq Khan

    using Include directive in ASP .NET

    Farooq Khan, Oct 28, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    2,532
    Kevin Spencer
    Oct 28, 2003
  2. Franz
    Replies:
    5
    Views:
    2,577
    Franz
    Jan 31, 2006
  3. Replies:
    0
    Views:
    431
  4. japh
    Replies:
    4
    Views:
    13,280
    Mike Hewson
    Jan 7, 2005
  5. Andreas Bogenberger
    Replies:
    3
    Views:
    1,290
    Andreas Bogenberger
    Feb 22, 2008
  6. Bing
    Replies:
    6
    Views:
    888
    Pascal J. Bourguignon
    Nov 6, 2008
  7. Falk Köppe
    Replies:
    4
    Views:
    3,498
    Wojtek
    May 19, 2009
  8. jacob navia

    The #include directive

    jacob navia, Jan 24, 2010, in forum: C Programming
    Replies:
    22
    Views:
    1,033
    Richard Tobin
    Jan 26, 2010
Loading...