What is use of UiHint and FilterUiHint in asp.net mvc
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Nikhil LadvaPosted Sep 20, 2016, 4:22 AM
Guest UserPosted Sep 20, 2016, 3:27 AM
Akash VarshneyPosted Sep 20, 2016, 3:08 AM
UIHintAttribute Specifies the template or user control that Dynamic Data uses to display a data field.
This is the MSDN description of UIHintAttribute. It firstly introduced for Dynamic Data applications and ASP.NET MVC also adapted it.
If you annotate a property with UIHint attribute and use
EditorFororDisplayForinside your views, ASP.NET MVC framework will look for the specified template which you specified throughUIHintAttribute. The directories it looks for is:For
EditorFor:For
DisplayFor:If you are on an area, it applies to your area like above as well.
Here is the usage sample:
MVC framework will look for partial view named
poounder the specified directories if you try to output the model property withEditorFororDisplayForlike below: