.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

dataannotation when should we not use it

Posted By:      Posted Date: September 13, 2010    Points: 0   Category :ASP.Net
well i want you guys point of view about the use of data annotations. when should we not use . or how should i use it when there are two or more tables on the form?

View Complete Post

More Related Resource Links

DataAnnotation on multiple user controls displaying on wrong control


I have a table that displays a user control on each row. The user controls are strongly typed to a viewmodel which contains DataAnnotation style validation. If one of the rows has invalid data entered (lets say the 3rd row) the data annotation validates display agains the first row/user control.

How do I get the data annotation to show against the relevant user control?

I'd post a pic to show what I mean except it will not display it!.:/

DataAnnotation with .edmx complex type


I have a problem.

In edmx Contact entity PersonalInfo complex type is defined with property FullName and Title.

In view the code is

<div class="editor-label">
                <%: Html.LabelFor(model => model.PersonalInfo.FullName) %>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.PersonalInfo.FullName) %>
                <%: Html.ValidationMessageFor(model => model.PersonalInfo.FullName) %>

Got buddy class like
    public partial class Contact

    public class ContactValidation

        public string FullName { get; set; }

When I submit form get an error of mapping but if I take FullName out of complex type than form is working fine.
How I validate FullName if it is in Complex type?


DataAnnotation [DisplayName("TitleLabel")] localization


I want to Localize DisplayName something like

[Required(ErrorMessageResourceType = typeof(Strings), ErrorMessageResourceName = "Required")] --> Working
[DisplayName(ResourceType = typeof(Strings), Name = "TitleLabel")] --> Not working
public string Title { get; set; }

Any suggestion please

JQuery support for DataAnnotation?


Is there any support from JQuery for DataAnnotations?

Found this but not sure if its supporting. http://bassistance.de/jquery-plugins/jquery-plugin-validation/

Anyone got any working example?


DataAnnotation DisplayColumn problem using RIA


I'm using RIA and VS2010, lastest bits as of 4-27-2010 I believe.

I've attributed a class that is contained within another (a Customer's child table record's detail table record) but my RIA dataForm with AutoGenerateFields="True" is only showing the "classname : primary key value".

I've changed my DomainService IQueryable<Customer> GetCustomers method to have the .Include("childtable.detailtable") and I can see the data I want displayed in the debugger within it's return value.

I would have imagined the [DisplayColumn("thePropertyIwantToShow")] would help...

Is there a 2 level limitation for Dynamic Data?

Am I missing something fundamental?




ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend