How to handle input and parameter validation between layers?

Posted by developr on Stack Overflow See other posts from Stack Overflow or by developr
Published on 2010-03-05T15:22:46Z Indexed on 2010/04/01 2:13 UTC
Read the original article Hit count: 372

Filed under:
|
|

If I have a 3 layer web forms application that takes user input, I know I can validate that input using validation controls in the presentation layer. Should I also validate in the business and data layers as well to protect against SQL injection and also issues? What validations should go in each layer?

Another example would be passing a ID to return a record. Should the data layer ensure that the id is valid or should that happen in BLL / UI?

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET