Server.Execute vs Include?

  • Thread starter Thread starter Keith Chadwick
  • Start date Start date
K

Keith Chadwick

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
 
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.
 
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!
 
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
 
Back
Top