Questions tagged [asp.net-mvc-2-validation]

The ASP.NET MVC 2 modelstate validation checks if a model is valid. You can define a correct model state and check if the users input matches that validation.

80 questions
0
votes
1 answer

ASP.NET MVC 2 RTM - Multiple-attribute validation with localization using data annotation fails

My resource file is working fine and the two keys (ValNameRequired and ValNameLength) are defined in the resource file. But when you have more than one attribute with localization, then the validation does not work. Anyone with a solution? public…
thd
  • 2,023
  • 7
  • 31
  • 45
0
votes
1 answer

text required Field MVC2 asp.net

I making a MVC2 project View: <%= Html.DropDownListFor ( m => m.CategoryId, Model.CategoryList )%> <%= Html.ValidationMessageFor ( m => m.CategoryId )%>
<%if ((Html.TextBoxFor(m => m.NewCategory)).Equals("")) %> <%{ show error msg…
0
votes
2 answers

Add validation rule to model property dynamically in asp.net mvc2

one model property validation info/rules are available in the other properties of same model object. i have to validate the property values using other properties values. Model class:- [FormatValidtion("Value", "Format", "MinLength",…
0
votes
1 answer

Display Error message on same view

I'm trying to delete a record from the database using MVC 2. currently delete function works fine but there are some records with foreign key relations so i don't wont them to be deleted and when user try to delete such a record i want to show a…
chamara
  • 12,649
  • 32
  • 134
  • 210
0
votes
1 answer

Server Side DropDown validation firing always

My MVC 2 dropdown validation fire always even though i select a item from the list. I checked from firebug the dropdown is bind correcly with expected values. Model: public class Delivery { public int DeliveryID { get; set; } …
chamara
  • 12,649
  • 32
  • 134
  • 210
1 2 3 4 5
6