This ASP.NET Security tutorial explains how to create secure web applications in ASP.NET.
You should always keep the following guidelines in mind when writing code in terms of web applications:
Never trust user input – Assume that every user is evil, until you have confirmed the opposite. You should always strongly validate [...]