There are a lot of sites, especially W3C that provides site-wide validation. On the other side, are web sites that require logons or internal only – never the twain can meet. Or can they?
I have a reasonable solution:
- To Web.Config, add an AppSetting “StandardsReview” that indicates if this site is in review mode.
- Automate things like logins with a specific account if any page is called and the user is not logged in.
- I use Master Pages, so this is an easy.
- Put an if/else around any code that you want to protect from accidental calls. Since you are using a specific account above – the account may be a safe testing-account and this coding is not needed. It really should be such a safe account.
The following assumes that the validators will walk all of the links from the home page. On the home page I drop this simple code:
Note that it is hidden visually and defaults to be not visible. If you are in StandardsReview, then Visible is set to true.
What is in this user control? The page is trivial:
And behind the scene we have:
What do we get? In normal operation:
and in StandardsReview every page is listed:
Now we can just expose the website on the real internet. Set up IIS to run this site. If you are like me, with a dynamic IP address, then just find that address and prefix it to the address and test away. Some of my favorite validation tools are:
- For HTML: http://validator.w3.org/
- For CSS: http://jigsaw.w3.org/css-validator/
- For Section 508: (be aware that there is no “Standards” that can be 100% mechanically implemented.
At the extreme case for an internal system – you can likely VPN into it and then by doing port forwarding, you can expose it for validation (just don’t IT Security about what you are doing….)