Saturday, 24 August 2013

why a string is added in wrong format to the razorview?

why a string is added in wrong format to the razorview?

i'm trying to add a few classes to a listitem object in my html using
razor and a helper method.
I defined a @functions{} section with a method :
public string AddClasses()
{
return "classes=\"class1 class2\"";
}
when using in razor
<li @AddClasses()>tekst</li>
the result is:
<li class=""class1" class2&quot;">tekst</li>
what am i doing wrong?

No comments:

Post a Comment