Modularised web code in asp.net / C#

Discussion in 'ASP .Net' started by =?Utf-8?B?RGFuIE5hc2g=?=, Aug 1, 2004.

  1. Hi

    I've just started learning web programming with ASP.net and C#, having been an "ordinary" ASP programmer for a few years.

    I used to use the #include directive to attach files created which included functions, which I could call to display certain parts of a site (the menu, top bar, footer, etc) to make life easier.

    My question is simply.. what's the best way to do a similar thing in ASP.net / C#? Should I still use #include? I've a feeling there's a better way these days! (BTW, these included functions frequently referenced the database).

    Thanks for any help,

    Cheers


    Dan
    =?Utf-8?B?RGFuIE5hc2g=?=, Aug 1, 2004
    #1
    1. Advertising

  2. Dan,

    User Controls have replaced include files in ASP.NET

    Also do some searches on google for ASP.NET base page. Using a base page
    means creating a .aspx page that is then inherited by all pages on a site so
    that common functionality is always included.

    --
    Sincerely,

    S. Justin Gengo, MCP
    Web Developer / Programmer

    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzsche
    "Dan Nash" <Dan > wrote in message
    news:...
    > Hi
    >
    > I've just started learning web programming with ASP.net and C#, having

    been an "ordinary" ASP programmer for a few years.
    >
    > I used to use the #include directive to attach files created which

    included functions, which I could call to display certain parts of a site
    (the menu, top bar, footer, etc) to make life easier.
    >
    > My question is simply.. what's the best way to do a similar thing in

    ASP.net / C#? Should I still use #include? I've a feeling there's a better
    way these days! (BTW, these included functions frequently referenced the
    database).
    >
    > Thanks for any help,
    >
    > Cheers
    >
    >
    > Dan
    S. Justin Gengo, Aug 1, 2004
    #2
    1. Advertising

  3. =?Utf-8?B?RGFuIE5hc2g=?=

    Rocky Moore Guest

    Big changes from ASP to ASP.NET. As mentioned, web user controls are the
    way to go. If you want to make a templated type site, you might check out
    my RJContentPanel control. It is free and helps to build multi page sites
    quickly. I use it in most of my sites. For HintsAndTips though, I had to
    add URL rewriting to make it more search engine friendly.

    --
    Rocky Moore
    www.HintsAndTips.com / Share your tips - Earn rewards
    www.MyQuickPoll.com / 2004 Election poll ID #33
    www.GotTheAnswerToSpam.com / Block virtually all spam email
    www.RJSoft.com/Products/RJContentPanel/ - Free web user template content
    control!


    "Dan Nash" <Dan > wrote in message
    news:...
    > Hi
    >
    > I've just started learning web programming with ASP.net and C#, having

    been an "ordinary" ASP programmer for a few years.
    >
    > I used to use the #include directive to attach files created which

    included functions, which I could call to display certain parts of a site
    (the menu, top bar, footer, etc) to make life easier.
    >
    > My question is simply.. what's the best way to do a similar thing in

    ASP.net / C#? Should I still use #include? I've a feeling there's a better
    way these days! (BTW, these included functions frequently referenced the
    database).
    >
    > Thanks for any help,
    >
    > Cheers
    >
    >
    > Dan
    Rocky Moore, Aug 1, 2004
    #3
  4. Okay, thanks guys. I've created my headers and footers using User Controls and all is working well.

    But what about the "bits of code" that I have in ASP files that I used to use the include directive for? I'm talking about encryption routines, profantity filters etc, just little.. Sub...End Sub routines. I want to convert these all to C#.. there must be away of adding these to my projects at runtime so I can use these functions?

    Cheers!


    Dan


    "Dan Nash" wrote:

    > Hi
    >
    > I've just started learning web programming with ASP.net and C#, having been an "ordinary" ASP programmer for a few years.
    >
    > I used to use the #include directive to attach files created which included functions, which I could call to display certain parts of a site (the menu, top bar, footer, etc) to make life easier.
    >
    > My question is simply.. what's the best way to do a similar thing in ASP.net / C#? Should I still use #include? I've a feeling there's a better way these days! (BTW, these included functions frequently referenced the database).
    >
    > Thanks for any help,
    >
    > Cheers
    >
    >
    > Dan
    =?Utf-8?B?RGFuIE5hc2g=?=, Aug 2, 2004
    #4
  5. =?Utf-8?B?RGFuIE5hc2g=?=

    Joerg Jooss Guest

    Dan Nash wrote:
    > Okay, thanks guys. I've created my headers and footers using User
    > Controls and all is working well.
    >
    > But what about the "bits of code" that I have in ASP files that I
    > used to use the include directive for? I'm talking about encryption
    > routines, profantity filters etc, just little.. Sub...End Sub
    > routines. I want to convert these all to C#.. there must be away of
    > adding these to my projects at runtime so I can use these functions?


    Not at run time -- at compile time. Put this functionality in utility
    classes and use these classes from you code behind classes.

    Cheers,
    --
    Joerg Jooss
    Joerg Jooss, Aug 7, 2004
    #5
    1. Advertising

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. r dubey
    Replies:
    2
    Views:
    3,255
    ʹÃûÑï
    Dec 15, 2003
  2. Peri
    Replies:
    2
    Views:
    2,946
  3. Nathan Sokalski
    Replies:
    6
    Views:
    4,085
    Nathan Sokalski
    Aug 29, 2006
  4. dev648237923
    Replies:
    3
    Views:
    521
    Steven Cheng[MSFT]
    Feb 9, 2007
  5. Replies:
    0
    Views:
    1,744
Loading...

Share This Page