I don't understand at what code you are referring to, because the blog post you refrenced is a Razor example while the code you reprorted its aspx.
Please let me understand what code are youre ferring to.
There are 3 similar example contained in the
- A razor example (the one referred in the blog post)
- An aspx Mvc 3 example
- An Mvc 2 example
There is another razore example too, on advanced filtering...but for sure you are not referring to it
Anyway, I tried the changes you reported in the razor example and it works fine for me. Consider that Require attribute errors are not immediately shown in unobtrusive validation, but they are shown either after you submit the form or after you write something
and then leve the textbox at least once. Otherwise the filed is considered "not yet changed by the user" and no error is shown also if the filed is empty. This is a general feature of unobtrusive validation.
If you use the TypedTextBox instead of the simple textbox, the error is always shown immediately, so you might solve substituting the textbox with the TypedTextBox.
Finally I don't understang why you tried to change the DisplayItem template...errors should be shown when you are in edit mode, that is when the Edit template is on the screen, so
Try to submit the form and see if the error is shown. Let me know what happens.