Web Connection
Docheader deprecated? replacement?
Gravatar is a globally recognized avatar based on your email address. Docheader deprecated? replacement?
  Eddie Caldwell
  All
  Mar 3, 2017 @ 09:17am

The Docheader and Docfooter methods are in the #IF INCLUDE_LEGACY_RESPONSEMETHODS section of code so they no longer work unless you use the old wwpageresponse40.

I am not sure if this by design or mistake since the help file indicates it is still part of wwpageresponse. http://west-wind.com/webconnection/docs/_1o80yq37z.htm

Is there a replacement or preferred way to perform this function now?

Gravatar is a globally recognized avatar based on your email address. re: Docheader deprecated? replacement?
  Rick Strahl
  Eddie Caldwell
  Mar 3, 2017 @ 01:48pm

You can add the legacy methods which gets them back for you to use.

But frankly it's a bad approach. You shouldn't be creating HTML in code, but rather use scripts and templates to render your HTML.

If you really want to use code the current version of Web Connection includes wwProcessPageHeaderTemplate() and wwProcessPageFooterTemplate() that do similar things to DocHeader/DocFooter of the response class but provide a way to create a custom template.

Take a look at the getting started walk through:

In the end using Scripts and Templates is the best approach though - writing HTML in code should be relegated to framework code.

For working with scripts and tempaltes take a look at the MVC/business object walk through:

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Docheader deprecated? replacement?
  Eddie Caldwell
  Rick Strahl
  Mar 3, 2017 @ 03:40pm

Thanks so much for the quick response you provided!! Very much appreciated.

I have never used them. I was just trying to handle the few places response.htmlheader is used in wwbanner and wwmaint and thought docheader might be the way to go.

BTW, wwMaint :: ShowTextFile also uses the depricated Response.ContentTypeHeader("text/plain").

Or is contenttypeheader ok to use where it is using wwresponse instead of wwpageresponse? Did I miss a subtlety that wwpageresponse is not used in wwmaint, that wwresponse is used instead?

Gravatar is a globally recognized avatar based on your email address. re: Docheader deprecated? replacement?
  Rick Strahl
  Eddie Caldwell
  Mar 3, 2017 @ 08:57pm

Sure old versions use those function, but newer versions do not. If they do that needs to be fixed, but I'm pretty sure I removed all of it in the last refactor for 6.07.

+++ Rick ---

© 1996-2024