views:

59

answers:

1

Sorry my poor english!

I'm trying to use the data annotation validators to make my validation server-side, I'm driving through this tutorial asp.net site: http://www.asp.net/learn/mvc/tutorial-39-cs.aspx, but is giving error in the time I put the attributes [Required], [StringLength (10)], etc., that because I'm using vb.net. When I create a C # project makes no such problem in the recognition of these attributes, I've tried to change the bracket by parentheses, but still giving error!

Does anyone know the right convention for the use of these attributes in vb?

Thanks

A: 

You declare attributes in VB.Net using angle brackets rather than square brackets. Also, don't forget the line continuation character if you want them to cross multiple lines:

<Required> _
<StringLength(10)> _
Public Name As String
Joel Coehoorn
Joel,Thak you very much! ;)
Juliana Machado