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
KeithNeither, 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" <kchadwick@.leewardsystems.com> wrote in message
news:uRseM1HpDHA.1960@.TK2MSFTNGP12.phx.gbl...
> 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
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$A71.375@.newssvr14.news.prodigy.com. ..
> 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" <kchadwick@.leewardsystems.com> wrote in message
> news:uRseM1HpDHA.1960@.TK2MSFTNGP12.phx.gbl...
> > 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
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" <kchadwick@.leewardsystems.com> wrote in message
news:%23adm3qJpDHA.1676@.TK2MSFTNGP09.phx.gbl...
> 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$A71.375@.newssvr14.news.prodigy.com. ..
> > 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" <kchadwick@.leewardsystems.com> wrote in message
> > news:uRseM1HpDHA.1960@.TK2MSFTNGP12.phx.gbl...
> > > 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
> >
Now that sounds like a more reasonable solution to me as well.
Cheers
Keith
"Jeff" <jsiver@.dls.net> wrote in message
news:O7bV3ycpDHA.3688@.TK2MSFTNGP11.phx.gbl...
> 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" <kchadwick@.leewardsystems.com> wrote in message
> news:%23adm3qJpDHA.1676@.TK2MSFTNGP09.phx.gbl...
> > 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$A71.375@.newssvr14.news.prodigy.com. ..
> > > 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" <kchadwick@.leewardsystems.com> wrote in message
> > > news:uRseM1HpDHA.1960@.TK2MSFTNGP12.phx.gbl...
> > > > 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
> > > > > >
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment