asp.net mvc 2 - ASP MVC 2 Data Annotations not working with VS2008/ASP 3.5? -


I've added data annotations in the 'friends' category referred to in MS guidance. Specifically, [DisplayName ("name")] does not affect anything. My understanding is that the value assigned to annotations should be used by Html.LabelFor (m = & gt; m.Attribute) assistant to reference the assigned value and label for the field.

Am I wrong on this?

I saw in the data class that there is a strong-type view called Antitian name + antitonym_ deviation. Need to pull extra components?

I tried to make a scene to use one of those types and there is no loft in the resultant scene. Maybe it's a different topic that is completely UIHint does not seem to affect any effect.

As mentioned, it is ASP.NET 3.5 code, in VS 2008. I am using SQL from Linux, perhaps it also makes the full use of data annotation ineligible.

  using the system; Using System.Collections.Generic; Using System.ComponentModel; Using System.ComponentModel.DataAnnotations; Using System.Linq; Using System.Web; Namespace Sample.Models {[MetadataType (typeof (SampleRequest_Validation)) Public Partial Class SampleRequest {Public Class SampleRequest_Validation {[DisplayName ("Project Description:")] [Required (Error Message = "Project Description Required")] [ StringLength (500, error message = "project description can not be more than 500 characters."]] [UIHint ("TextArea")] String ProjectDescription {get; Set;}  

I think I'm missing some context somewhere ...

thanks

OK, there was some deficiency ...

If I did not declare publicly class attibutes, then certainly failed in data annotation is.

The code snippet should read above the previous lisne:

  public string projectDescription {find; Set;}  

Little things ...


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -