Click to See Complete Forum and Search --> : asp validation, etc.


heavenly_blue
12-09-2004, 01:33 PM
Is there anything that can validate my ASP code, similar to the W3C html validation?

...or is this unecessary? if the code executes w/o any errors, it's fine?

What about using things like this:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

Do I have to use that on each asp file? Is that similar to DOCTYPE in HTML? What problems could happen if I omit that from my ASP pages?

Are there any resources that provide information about making more correctly structured ASP code, semantics, etc?

I know enough about ASP to make functional pages, but I want to know everything about it, and make sure everything I write is proper.

Any other suggestions are welcome as well.

russell
12-09-2004, 02:05 PM
Is there anything that can validate my ASP code, similar to the W3C html validation?
no. not necessary


<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
Also not necessary

A few tips for structure:
1. Use option explicit at the top of your pages, but remove it beofre publishing them
2. Break code up into Subs and functions
3. Don't nest include files
4. Don't execute code from includes, just constants, functions and subs in your includes that are called from the display pages.
5. don't waste your time with this <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>, just open your script tags <% -- the default language is vbscript anyway. You need that tag only if you intend to use JScript
6. Use the With command:
With Response
.Write "myString"
.Write "AnotherString"
End With
7. Learn to create and use ASP Classes.