What is the use of FilterUIHintAttribute and give example
What is the use of FilterUIHintAttribute and give example in asp.net mvc
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
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
Bikesh SrivastavaRank #108 · 20.3K reputationPosted Oct 12, 2016, 5:27 AM EDT
You could use the
AdditionalMetadataattribute:[UIHint("DateTime")] [AdditionalMetadata("foo", "bar")] public DateTime Date { get; set; }and in the template:
so if you wanted to pass an url:
[UIHint("DateTime")] [AdditionalMetadata("controller", "somecontroller")] [AdditionalMetadata("action", "someaction")] [AdditionalMetadata("property", "someproperty")] public DateTime Date { get; set; }and in your template:
@{ var values = ViewData.ModelMetadata.AdditionalValues; } script type="text/javascript"> $('.auto').autocomplete({ source: function (request, response) { $.ajax({ url: '@Url.Action((string)values["action"], (string)values["controller"])', dataType: "json", data: { filter: request.term }, success: function (data) { response( $.map(eval(data), function (item) { return { label: item['@values["property"]'] } }) ); } }); } }); script>