Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Troubles with jquery ui dialog and save method
Message
From
03/04/2013 10:20:56
 
General information
Forum:
ASP.NET
Category:
MVC
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01569821
Message ID:
01569888
Views:
24
Are you evaluating that the model data is valid? (ModelState.IsValid)

>Good that I looked.
>
>I used
>
> [StringLength(5)]
>
>and I don't know why did I use this instead of MaxLength. I am going to change that and re-try.
>
>Hmm, this should not make a difference
>
>http://stackoverflow.com/questions/5717033/stringlength-vs-maxlength-attributes-asp-net-mvc3-with-ef-4-1-code-first
>
>
> [ComplexType]
>    public class PhoneInfo
>    {
>        [DataType(DataType.PhoneNumber)]
>        
>        [DisplayName("Phone")]
>        [RegularExpression(@"^((\(\d{3}\)|\d{3})\s?)?\d{3}[-\s]?\d{4}\s*$", ErrorMessage = "Please enter valid Phone Number")]
>        public virtual string Phone { get; set; }
>
>        [StringLength(5)]
>        [DisplayName("Ext")]
>        public virtual string Ext { get; set; }
>
>        public bool HasValue
>        {
>            get
>            {
>                return (Phone != null || Ext != null);
>            }
>        }
>
>    }
>
>In my view I didn't even touch that field, I only put some data in the Address field. Why would it generate an error?
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform