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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Akash VarshneyRank #1,895 · 780 reputationPosted Sep 19, 2016, 11:08 PM EDT
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:
public class Person { [UIHint("Poo")] public string Name { get; set; } }MVC framework will look for partial view named
poounder the specified directories if you try to output the model property withEditorFororDisplayForlike below:Guest UserRank #2,002 · 726 reputationPosted Sep 19, 2016, 11:27 PM EDT
Nikhil Ladva129 reputationPosted Sep 20, 2016, 12:22 AM EDT