Questions tagged [asp.net-mvc-2-metadata]
8 questions
4
votes
1 answer
Unit Testing MetadataType
I'm working on a ASP.NET MVC 2 application and i test my Viewmodels Like this
[TestMethod]
public void EmailNeedsToBeSet()
{
var pvm = new ProfileViewModel {Email = ""};
var validationResults = new ValidationResults();
var result =…

domueni
- 304
- 8
- 19
2
votes
1 answer
DataAnnotations over WCF
I'm sending a DTO over wire (WCF) which has on one property the DisplayName atribute from System.ComponentModel and on a other one the ScaffoldColumn attribute. On the client I have a ASP.NET MVC 2 app and I use the Html.EditorFor(x=>x.DTO)…

user137348
- 10,166
- 18
- 69
- 89
1
vote
4 answers
How-to set the Description property of the ModelMetadata
I've putted a Description attribute on my property,but the Description property on the ModelMetada is null anyway.
[Description("sss")]
public int Id { get; set; }
BTW Is I've putted corect?
EDIT
I've had a look at the MVC source. It doesn't seem…

user137348
- 10,166
- 18
- 69
- 89
0
votes
1 answer
Radio button value check in action is true or false
I am new in MVC. I am working on a view where I add two radio buttons.
0
votes
2 answers
Partial class for data validation in asp.net MVC2
I am creating my first ASP.NET MVC2 application. I am trying to create a Partial Class for data validation as demonstrated in the nerdDinner application, but MetaDataType has a red line with the message : "The type or namespace 'MetadataType' could…

user695916
- 51
- 1
- 4
0
votes
1 answer
ASP.NET MVC2 - Determine which type of template is being rendered
Instead of using DisplayFor and EditorFor, I would like to create a more generic ContentFor. In that Html extension it would take into account Metadata values to determine how to render the resulting control. The only piece of the puzzle I am not…
0
votes
1 answer
Using Generic Types with MVC2 Templates
I have a model class that is a generic type. I would like to create a custom editor template that would display it (and put it in the Shared folder).
How can I do that?
I can't figure out how to name it so that MVC2 would pick it up over the…
0
votes
0 answers
How to get model instance inside a DataAnnotationsModelMetadataProvider derived class?
How can I get a model instance inside a DataAnnotationsModelMetadataProvider derived class in MVC2? To be more precise, how can I get the model instance to which a property belongs, inside a GetMetadataForProperty derived method?

Guillermo Gutiérrez
- 17,273
- 17
- 89
- 116