Questions tagged [asp.net-mvc-uihint]

12 questions
45
votes
1 answer

What is use of UIHint attribute in MVC

Can anyone please explain me what is the use of UIHint attribute in MVC . Why do we need this. and when and how to use . Thanks
user1030181
  • 1,995
  • 5
  • 26
  • 56
23
votes
2 answers

UIHint Attribute in MVC

What is Use of UIHint Attribute in MVC . Can anyone please provide me a simple example of how to use it and what it does.
user1030181
  • 1,995
  • 5
  • 26
  • 56
6
votes
1 answer

How to I find the target property of a UIHInt attribute?

I have the following UIHInt based attibute: [AttributeUsage(AttributeTargets.Property)] public class DropDownListAttribute : UIHintAttribute, IMetadataAware { public DropDownListAttribute(string selectListName) :…
ProfK
  • 49,207
  • 121
  • 399
  • 775
5
votes
3 answers

UIHint can not resolve template in abstract models

Assume an abstract model like this: public abstract class MyClass : BaseEntity { [UIHint("File")] public long? DocumentFileId { get; set; } } The problem is Cannot resolve template 'File', while there is File.cshtml in View editor…
3
votes
1 answer

ASP.NET MVC Generate DropDownList using UIHint Attribute

I would like to know how can I generate a DropDownList using an UIHint attribute. I already customized some of the predefined attributes but I don't know how to proceed for generating DropDownLists. Here is how I did with my last one and I want to…
tzortzik
  • 4,993
  • 9
  • 57
  • 88
2
votes
1 answer

ASP.NET MVC : access container from EditorTemplate

I have a view model AssetFreezeViewModel.cs that contains the following property : public AssetFreezeAccountBalanceViewModel AccountBalanceInfo { get; set; } I have a view Details.cshtml based on the ViewModel above with that line…
2
votes
0 answers

How to use UiHint and jQuery function For multiple inputs?

I have an model that named mymodel and include this public class MyModel { public int id { get; set; } public string name{get;set;} [UIHint("_ViewDate")] public string date { get; set; } } Data View Page : @section scripts …
Mohsen Zahedi
  • 651
  • 2
  • 10
  • 28
1
vote
2 answers

ASP.NET MVC Manually Applying DisplayFormat

I have a model with a property which is a generic looking something like: class PairedData { public T Value {get;set;} public bool IsValid {get;set;} } In the model I have: class SomeModel { [UIHint ("PairedInt")] public…
Jasper Kent
  • 3,546
  • 15
  • 21
0
votes
1 answer

UIHint - Disable Mvc.TemplateNotResolved for project or solution

On Rider and Visual Studio + ReSharper, UIHint attributes that cannot be resolved by IDE are highlighted as red. For example: There are a few solution on how to bypass the warning: Either configure severity of the Inspection in the IDE (default is…
Dariusz Woźniak
  • 9,640
  • 6
  • 60
  • 73
0
votes
1 answer

UIHint not working under model DisplayTemplate

I Have a model MyModel public class MyModel { [UIHint("Str")] public string Name {get;set;} } In the View, I am rendering model using @Html.DisplayForModel("SomeTemplate") So, the model is using SomeTemplate as…
0
votes
2 answers

Is there a list that states the datatypes that you can use with the [UIHints] tag in MVC?

Is there a list of all the UIHints that you can call in MVC 3? I checked Google and searched on here, but was unable to find a list. Any help is…
0
votes
1 answer

UIHint and RegularExpression annotations are not working together MVC4

my actual problem was here: Clinetside regular expression validation in MVC4 My model is: public partial class PartyRole { [UIHint("TextBox")] [RegularExpression(@"^.{5,}$", ErrorMessage="Minimum 5 characters required")] [StringLength(50,…
mmssaann
  • 1,507
  • 6
  • 27
  • 55