I have gone through a couple of articles regarding UIHint attribute in mvc but none of them specifies clearly what it is or advantages of using it and also how to implement it in code.
Thanks!
I have gone through a couple of articles regarding UIHint attribute in mvc but none of them specifies clearly what it is or advantages of using it and also how to implement it in code.
Thanks!
The benefit of "UIHint" attribute is that it allows you to selectively apply the template. Let's say that you create an editor template for bool. If you name it "bool" it will automatically apply on all bool fields. But if you name it "abc123" you have the luxury of calling it selectively by decorating the property in your model with the "UIHint" attribute and only having it replace the default handlers as you desire.
It is easiest to understand that all types have a default handler so when you're using "TextboxFor", that too is applying a template, it just happens to be a native one as opposed to a custom template of your choosing.