Boy, that's a pretty general question. I'll do my best, but be prepared to see me miss by a mile.
Assumptions
- You are using ASP.NET, not plain ASP
- You don't really want to test your web pages, but the logic behind them. Unit testing the actual .ASPX pages is rather painful, but there are frameworks out there to do it. NUnitAsp is one.
The first thing to do is to organize (or plan) your code so that it can be tested. The two most popular design patterns for this at the time seem to be MVP and MVC. Both separate the logic of the application away from the view so that you can test the logic without the view (web pages) getting in your way.
Either MVP or MVC will be effective. MVC has the advantage of having a Microsoft framework almost ready to go.
Once you've selected a framework pattern that encourages testability, you need to use a unit testing tool. NUnit is a good starting point. Visual Studio Professional has a testing suite built it, but NUnit + TestDrive.NET also works in the IDE.
That's sort of a shotgun blast of information. I hope some if it hits. The Pragmatic Bookshelf has a good book covering the topic.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…