User122281327 posted
Actually is a bit more complicated... I´d recommend you to read this excellent tutorial wrote by Scott Mitchell,
vb
http://www.asp.net/learn/security/tutorial-07-vb.aspx
c#
http://www.asp.net/learn/security/tutorial-07-cs.aspx
If my reply helped you please "Mark it as Answer"