Server.Execute vs Include?

Discussion in 'ASP .Net' started by Keith Chadwick, Nov 6, 2003.

  1. I have several small pieces of common code that get applied to each page.
    Which is better a better way of including them in other pages? Use the
    traditional include statement or go with the Server.Execute("pagename")
    method.

    Thanks
    Keith
     
    Keith Chadwick, Nov 6, 2003
    #1
    1. Advertising

  2. Neither, unless the code absolutely has to be in a "webform"

    Instead, just create a module or class and call the code like you would any
    other function.


    "Keith Chadwick" <> wrote in message
    news:...
    > I have several small pieces of common code that get applied to each page.
    > Which is better a better way of including them in other pages? Use the
    > traditional include statement or go with the Server.Execute("pagename")
    > method.
    >
    > Thanks
    > Keith
    >
    >
     
    Boban Dragojlovic, Nov 6, 2003
    #2
    1. Advertising

  3. That seems rather silly to create a class simply to write out 4 or 5 lines
    of HTML with reponse.write. Not to mention maintaining all the dam double
    quotes within the reponse.write text. All my HTML conforms to the standards
    required for MSXML and XSL/XSLT. Placing everything in an object for the
    sake of making an object makes it much more dificult to debug. OOP is a
    wonderfull thing but only when applied where appropriate.

    I think I will stick with include files for things of this nature. The
    server.execute is fine but objects defined by the parent are not available
    to the child whereas in an include they are.

    Keith

    PS: The microsoft guy told me to stay away from modules!


    "Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in message
    news:lduqb.847$...
    > Neither, unless the code absolutely has to be in a "webform"
    >
    > Instead, just create a module or class and call the code like you would

    any
    > other function.
    >
    >
    > "Keith Chadwick" <> wrote in message
    > news:...
    > > I have several small pieces of common code that get applied to each

    page.
    > > Which is better a better way of including them in other pages? Use the
    > > traditional include statement or go with the Server.Execute("pagename")
    > > method.
    > >
    > > Thanks
    > > Keith
    > >
    > >

    >
    >
     
    Keith Chadwick, Nov 6, 2003
    #3
  4. Keith Chadwick

    Jeff Guest

    I think the easiest way is to throw the HTML and other stuff into User
    Controls. Then you just drop the user controls onto your web page for them
    to appear. These are similiar to includes but better.

    Jeff

    "Keith Chadwick" <> wrote in message
    news:%...
    > That seems rather silly to create a class simply to write out 4 or 5 lines
    > of HTML with reponse.write. Not to mention maintaining all the dam double
    > quotes within the reponse.write text. All my HTML conforms to the

    standards
    > required for MSXML and XSL/XSLT. Placing everything in an object for the
    > sake of making an object makes it much more dificult to debug. OOP is a
    > wonderfull thing but only when applied where appropriate.
    >
    > I think I will stick with include files for things of this nature. The
    > server.execute is fine but objects defined by the parent are not available
    > to the child whereas in an include they are.
    >
    > Keith
    >
    > PS: The microsoft guy told me to stay away from modules!
    >
    >
    > "Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in message
    > news:lduqb.847$...
    > > Neither, unless the code absolutely has to be in a "webform"
    > >
    > > Instead, just create a module or class and call the code like you would

    > any
    > > other function.
    > >
    > >
    > > "Keith Chadwick" <> wrote in message
    > > news:...
    > > > I have several small pieces of common code that get applied to each

    > page.
    > > > Which is better a better way of including them in other pages? Use

    the
    > > > traditional include statement or go with the

    Server.Execute("pagename")
    > > > method.
    > > >
    > > > Thanks
    > > > Keith
    > > >
    > > >

    > >
    > >

    >
    >
     
    Jeff, Nov 8, 2003
    #4
  5. Now that sounds like a more reasonable solution to me as well.

    Cheers
    Keith


    "Jeff" <> wrote in message
    news:...
    > I think the easiest way is to throw the HTML and other stuff into User
    > Controls. Then you just drop the user controls onto your web page for

    them
    > to appear. These are similiar to includes but better.
    >
    > Jeff
    >
    > "Keith Chadwick" <> wrote in message
    > news:%...
    > > That seems rather silly to create a class simply to write out 4 or 5

    lines
    > > of HTML with reponse.write. Not to mention maintaining all the dam

    double
    > > quotes within the reponse.write text. All my HTML conforms to the

    > standards
    > > required for MSXML and XSL/XSLT. Placing everything in an object for the
    > > sake of making an object makes it much more dificult to debug. OOP is a
    > > wonderfull thing but only when applied where appropriate.
    > >
    > > I think I will stick with include files for things of this nature. The
    > > server.execute is fine but objects defined by the parent are not

    available
    > > to the child whereas in an include they are.
    > >
    > > Keith
    > >
    > > PS: The microsoft guy told me to stay away from modules!
    > >
    > >
    > > "Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in message
    > > news:lduqb.847$...
    > > > Neither, unless the code absolutely has to be in a "webform"
    > > >
    > > > Instead, just create a module or class and call the code like you

    would
    > > any
    > > > other function.
    > > >
    > > >
    > > > "Keith Chadwick" <> wrote in message
    > > > news:...
    > > > > I have several small pieces of common code that get applied to each

    > > page.
    > > > > Which is better a better way of including them in other pages? Use

    > the
    > > > > traditional include statement or go with the

    > Server.Execute("pagename")
    > > > > method.
    > > > >
    > > > > Thanks
    > > > > Keith
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Keith Chadwick, Nov 9, 2003
    #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. Andreas Bogenberger
    Replies:
    3
    Views:
    940
    Andreas Bogenberger
    Feb 22, 2008
  2. Wilk Teverbaugh

    Server.execute inside include file

    Wilk Teverbaugh, Nov 16, 2003, in forum: ASP General
    Replies:
    0
    Views:
    153
    Wilk Teverbaugh
    Nov 16, 2003
  3. Savas Ates
    Replies:
    1
    Views:
    287
    Patrice
    Aug 17, 2004
  4. Bill
    Replies:
    5
    Views:
    601
  5. Sike
    Replies:
    2
    Views:
    188
Loading...

Share This Page