i want to trim a string in asp.net mvc . i will be doing that in controller where there is a updatemodel implemented or datannotation class or a view? where will be i doing that?
+3
A:
If you want trim strings that Users have entered then take a look at this answer
Although this answer only overrides the SetProperty method you could always extend the class and add a method to override the GetPropertyValue
Barry
2010-08-20 10:00:33
As Barry has said, take a look at that answer. I also implemented a my own ModelBinder that automatically trimmed strings. Much better.
uriDium
2010-08-20 10:06:54