0
votes

I'm working with my first MVC3, vb.net project and am having a problem with the follow code

@code
' builds standard list of attributes
   Dim s1 = SharedAttributeBuilder.BuildAttributes(Me) 
End Code
@Html.TextAreaFor(Model >= Model, 2, 30, @s1)

My problem is with the @s1 on the last line. When I build, I'm getting an "expression expected" error message. I'm somewhat confused as this last line runs fine in other c# projects. I've tried @(s1) and doesn't work.

Can someone point me in the right direction.


EDIT One of my co-workers solved it for me. I have to use vb syntax for lamdas. Duh on my part. Working line looks like

@Html.TextAreaFor(Function(Model) Model, 2, 30, s1)
1

1 Answers

0
votes

tom,

doesn't:

@Html.TextAreaFor(model => model.someproperty, 2, 30, s1)

work (i.e. replacing @s1 with plain old s1)??

Certainly in c# this would work as expected (notice the lower-case model plus associated property, plus => rather than >=).