This is a migrated thread and some comments may be shown as answers.

[Solved] Grid not allow customize validation attribute

1 Answer 114 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dio
Top achievements
Rank 1
Dio asked on 20 Apr 2012, 06:17 AM
Hi all.

I use a customize validation attribute in my model. It is inherited from StringLengthAttribute, only specified resource file to support multiply language. But I seem in insert popup windows. There encounter a strange error "Error! The requested URL returned 404 - Not Found". Who know how to handle it?

    public class StringLengthMLAttribute : StringLengthAttribute
    {
        public StringLengthMLAttribute(int maximunLength)
            : base(maximunLength)
        {
            ErrorMessageResourceName = "ErrorStringLength";
            ErrorMessageResourceType = typeof(Messages);
        }
    }

    [KnownType(typeof(Project))]
    public class Project
    {
        [ScaffoldColumn(false)]
        public System.Guid id { get; set; }
 
        [Display(Name = "ProjectCode", ResourceType = typeof(LanguageDictionary))]
        [StringLengthML(1)]
        public string project_cd { get; set; }
      ......

1 Answer, 1 is accepted

Sort by
0
Dadv
Top achievements
Rank 1
answered on 23 Apr 2012, 11:23 AM
Are you sure that it is the Custom Validator the problem?

404 could be a lot of thing, did you try to remove it ?
Tags
Grid
Asked by
Dio
Top achievements
Rank 1
Answers by
Dadv
Top achievements
Rank 1
Share this question
or