Search Results

Search found 55 results on 3 pages for 'metadatatype'.

Page 3/3 | < Previous Page | 1 2 3 

  • NerdDinner form validation DataAnnotations ERROR in MVC2 when a form field is left blank.

    - by Edward Burns
    Platform: Windows 7 Ultimate IDE: Visual Studio 2010 Ultimate Web Environment: ASP.NET MVC 2 Database: SQL Server 2008 R2 Express Data Access: Entity Framework 4 Form Validation: DataAnnotations Sample App: NerdDinner from Wrox Pro ASP.NET MVC 2 Book: Wrox Professional MVC 2 Problem with Chapter 1 - Section: "Integrating Validation and Business Rule Logic with Model Classes" (pages 33 to 35) ERROR Synopsis: NerdDinner form validation ERROR with DataAnnotations and db nulls. DataAnnotations in sample code does not work when the database fields are set to not allow nulls. ERROR occurs with the code from the book and with the sample code downloaded from codeplex. Help! I'm really frustrated by this!! I can't believe something so simple just doesn't work??? Steps to reproduce ERROR: Set Database fields to not allow NULLs (See Picture) Set NerdDinnerEntityModel Dinner class fields' Nullable property to false (See Picture) Add DataAnnotations for Dinner_Validation class (CODE A) Create Dinner repository class (CODE B) Add CREATE action to DinnerController (CODE C) This is blank form before posting (See Picture) This null ERROR occurs when posting a blank form which should be intercepted by the Dinner_Validation class DataAnnotations. Note ERROR message says that "This property cannot be set to a null value. WTH??? (See Picture) The next ERROR occurs during the edit process. Here is the Edit controller action (CODE D) This is the "Edit" form with intentionally wrong input to test Dinner Validation DataAnnotations (See Picture) The ERROR occurs again when posting the edit form with blank form fields. The post request should be intercepted by the Dinner_Validation class DataAnnotations. Same null entry error. WTH??? (See Picture) See screen shots at: http://www.intermedia4web.com/temp/nerdDinner/StackOverflowNerdDinnerQuestionshort.png CODE A: [MetadataType(typeof(Dinner_Validation))] public partial class Dinner { } [Bind(Include = "Title, EventDate, Description, Address, Country, ContactPhone, Latitude, Longitude")] public class Dinner_Validation { [Required(ErrorMessage = "Title is required")] [StringLength(50, ErrorMessage = "Title may not be longer than 50 characters")] public string Title { get; set; } [Required(ErrorMessage = "Description is required")] [StringLength(265, ErrorMessage = "Description must be 256 characters or less")] public string Description { get; set; } [Required(ErrorMessage="Event date is required")] public DateTime EventDate { get; set; } [Required(ErrorMessage = "Address is required")] public string Address { get; set; } [Required(ErrorMessage = "Country is required")] public string Country { get; set; } [Required(ErrorMessage = "Contact phone is required")] public string ContactPhone { get; set; } [Required(ErrorMessage = "Latitude is required")] public double Latitude { get; set; } [Required(ErrorMessage = "Longitude is required")] public double Longitude { get; set; } } CODE B: public class DinnerRepository { private NerdDinnerEntities _NerdDinnerEntity = new NerdDinnerEntities(); // Query Method public IQueryable<Dinner> FindAllDinners() { return _NerdDinnerEntity.Dinners; } // Query Method public IQueryable<Dinner> FindUpcomingDinners() { return from dinner in _NerdDinnerEntity.Dinners where dinner.EventDate > DateTime.Now orderby dinner.EventDate select dinner; } // Query Method public Dinner GetDinner(int id) { return _NerdDinnerEntity.Dinners.FirstOrDefault(d => d.DinnerID == id); } // Insert Method public void Add(Dinner dinner) { _NerdDinnerEntity.Dinners.AddObject(dinner); } // Delete Method public void Delete(Dinner dinner) { foreach (var rsvp in dinner.RSVPs) { _NerdDinnerEntity.RSVPs.DeleteObject(rsvp); } _NerdDinnerEntity.Dinners.DeleteObject(dinner); } // Persistence Method public void Save() { _NerdDinnerEntity.SaveChanges(); } } CODE C: // ************************************** // GET: /Dinners/Create/ // ************************************** public ActionResult Create() { Dinner dinner = new Dinner() { EventDate = DateTime.Now.AddDays(7) }; return View(dinner); } // ************************************** // POST: /Dinners/Create/ // ************************************** [HttpPost] public ActionResult Create(Dinner dinner) { if (ModelState.IsValid) { dinner.HostedBy = "The Code Dude"; _dinnerRepository.Add(dinner); _dinnerRepository.Save(); return RedirectToAction("Details", new { id = dinner.DinnerID }); } else { return View(dinner); } } CODE D: // ************************************** // GET: /Dinners/Edit/{id} // ************************************** public ActionResult Edit(int id) { Dinner dinner = _dinnerRepository.GetDinner(id); return View(dinner); } // ************************************** // POST: /Dinners/Edit/{id} // ************************************** [HttpPost] public ActionResult Edit(int id, FormCollection formValues) { Dinner dinner = _dinnerRepository.GetDinner(id); if (TryUpdateModel(dinner)){ _dinnerRepository.Save(); return RedirectToAction("Details", new { id=dinner.DinnerID }); } return View(dinner); } I have sent Wrox and one of the authors a request for help but have not heard back from anyone. Readers of the book cannot even continue to finish the rest of chapter 1 because of these errors. Even if I download the latest build from Codeplex, it still has the same errors. Can someone please help me and tell me what needs to be fixed? Thanks - Ed.

    Read the article

  • ASP.NET MVC2 - usage of LINQ-generated class (validation problem)

    - by ile
    There are few things not clear to me about ASP.NET MV2. In database I have table Contacts with several fields, and there is an additional field XmlFields of which type is xml. In that field are stored additional description fields. There are 4 classes: Contact class which corresponds to Contact table and is defined by default when creating LINQ classes ContactListView class which inherits Contact class and has some additional properties ContactXmlView class that contains fields from XmlFields field ContactDetailsView class which merges ContactListView and ContactXmlView into one class and this one is used to display data in view pages ContactListView class has re-defined some properties from Contact class (so that I can add [Required] filter used for validation) - but I get warning message: 'ObjectTest.Models.Contacts.ContactListView.FirstName' hides inherited member 'SA.Model.Contact.FirstName'. Use the new keyword if hiding was intended. ContactDetailsView class is also used in a form when creating new contact and adding it to database. I am not sure if this is correct way, and the warning message confuses me a bit. Any advise about this? Thanks, Ile EDIT According to Jakob's instructions I tried it from scratch: [MetadataType(typeof(Person_Validation))] public partial class Person { } public class Person_Validation { [Required] string FirstName { get; set; } [Required] string LastName { get; set; } [Required] int Age { get; set; } } In Controller I have this: [HttpPost] public ActionResult Create(Person person, FormCollection collection) { if (ModelState.IsValid) { try { personRepository.Add(person); personRepository.Save(); } catch { return View(person); } } return RedirectToAction("Index"); } View: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Validate.Models.Person>" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> Create </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2>Create</h2> <% using (Html.BeginForm()) {%> <%= Html.ValidationSummary(true) %> <fieldset> <legend>Fields</legend> <div class="editor-label"> <%= Html.LabelFor(model => model.FirstName) %> </div> <div class="editor-field"> <%= Html.TextBoxFor(model => model.FirstName) %> <%= Html.ValidationMessageFor(model => model.FirstName) %> </div> <div class="editor-label"> <%= Html.LabelFor(model => model.LastName) %> </div> <div class="editor-field"> <%= Html.TextBoxFor(model => model.LastName) %> <%= Html.ValidationMessageFor(model => model.LastName) %> </div> <div class="editor-label"> <%= Html.LabelFor(model => model.Age) %> </div> <div class="editor-field"> <%= Html.TextBoxFor(model => model.Age) %> <%= Html.ValidationMessageFor(model => model.Age) %> </div> <p> <input type="submit" value="Create" /> </p> </fieldset> <% } %> <div> <%= Html.ActionLink("Back to List", "Index") %> </div> </asp:Content> When posting new person with no values, nothing happens (page is just reloaded). When posting with some values, person is added to db. I have no idea what am I doing wrong.

    Read the article

  • ASP.NET. MVC2. Entity Framework. Cannot pass primary key value back from view to [HttpPost]

    - by Paul Connolly
    I pass a ViewModel (which contains a "Person" object) from the "EditPerson" controller action into the view. When posted back from the view, the ActionResult receives all of the Person properties except the ID (which it says is zero instead of say its real integer) Can anyone tell me why? The controllers look like this: public ActionResult EditPerson(int personID) { var personToEdit = repository.GetPerson(personID); FormationViewModel vm = new FormationViewModel(); vm.Person = personToEdit; return View(vm); } [HttpPost] public ActionResult EditPerson(FormationViewModel model) <<Passes in all properties except ID { // Persistence code } The View looks like this: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Afp.Models.Formation.FormationViewModel>" %> <% using (Html.BeginForm()) {% <%= Html.ValidationSummary(true) % <fieldset> <legend>Fields</legend> <div class="editor-label"> <%= Html.LabelFor(model => model.Person.Title) %> </div> <div class="editor-field"> <%= Html.TextBoxFor(model => model.Person.Title) %> <%= Html.ValidationMessageFor(model => model.Person.Title) %> </div> <div class="editor-label"> <%= Html.LabelFor(model => model.Person.Forename)%> </div> <div class="editor-field"> <%= Html.TextBoxFor(model => model.Person.Forename)%> <%= Html.ValidationMessageFor(model => model.Person.Forename)%> </div> <div class="editor-label"> <%= Html.LabelFor(model => model.Person.Surname)%> </div> <div class="editor-field"> <%= Html.TextBoxFor(model => model.Person.Surname)%> <%= Html.ValidationMessageFor(model => model.Person.Surname)%> </div> <div class="editor-label"> <%= Html.LabelFor(model => model.DOB) %> </div> <div class="editor-field"> <%= Html.TextBoxFor(model => model.DOB, String.Format("{0:g}", Model.DOB)) <%= Html.ValidationMessageFor(model => model.DOB) %> </div>--%> <div class="editor-label"> <%= Html.LabelFor(model => model.Person.Nationality)%> </div> <div class="editor-field"> <%= Html.TextBoxFor(model => model.Person.Nationality)%> <%= Html.ValidationMessageFor(model => model.Person.Nationality)%> </div> <div class="editor-label"> <%= Html.LabelFor(model => model.Person.Occupation)%> </div> <div class="editor-field"> <%= Html.TextBoxFor(model => model.Person.Occupation)%> <%= Html.ValidationMessageFor(model => model.Person.Occupation)%> </div> <div class="editor-label"> <%= Html.LabelFor(model => model.Person.CountryOfResidence)%> </div> <div class="editor-field"> <%= Html.TextBoxFor(model => model.Person.CountryOfResidence)%> <%= Html.ValidationMessageFor(model => model.Person.CountryOfResidence)%> </div> <div class="editor-label"> <%= Html.LabelFor(model => model.Person.PreviousNameForename)%> </div> <div class="editor-field"> <%= Html.TextBoxFor(model => model.Person.PreviousNameForename)%> <%= Html.ValidationMessageFor(model => model.Person.PreviousNameForename)%> </div> <div class="editor-label"> <%= Html.LabelFor(model => model.Person.PreviousSurname)%> </div> <div class="editor-field"> <%= Html.TextBoxFor(model => model.Person.PreviousSurname)%> <%= Html.ValidationMessageFor(model => model.Person.PreviousSurname)%> </div> <div class="editor-label"> <%= Html.LabelFor(model => model.Person.Email)%> </div> <div class="editor-field"> <%= Html.TextBoxFor(model => model.Person.Email)%> <%= Html.ValidationMessageFor(model => model.Person.Email)%> </div> <p> <input type="submit" value="Save" /> </p> </fieldset> <% } % And the Person class looks like: [MetadataType(typeof(Person_Validation))] public partial class Person { public Person() { } } [Bind(Exclude = "ID")] public class Person_Validation { public int ID { get; private set; } public string Title { get; set; } public string Forename { get; set; } public string Surname { get; set; } public System.DateTime DOB { get; set; } public string Nationality { get; set; } public string Occupation { get; set; } public string CountryOfResidence { get; set; } public string PreviousNameForename { get; set; } public string PreviousSurname { get; set; } public string Email { get; set; } } And ViewModel: public class FormationViewModel { public Company Company { get; set; } public Address RegisteredAddress { get; set; } public Person Person { get; set; } public PersonType PersonType { get; set; } public int CurrentStep { get; set; } } }

    Read the article

  • xVal 1.0 not generating the correct xVal.AttachValidator script in view

    - by bastijn
    I'm currently implementing xVal client-side validation. The server-side validation is working correctly at the moment. I have referenced xVall.dll (from xVal1.0.zip) in my project as well as the System.ComponentModel.DataAnnotations and System.web.mvc.DataAnnotations from the Data Annotations Model Binder Sample found at http://aspnet.codeplex.com/releases/view/24471. I have modified the method BindProperty in the DataAnnotationsModelBinder class since it returned a nullpointer exception telling me the modelState object was null. Some blogposts described to modify the method and I did according to this SO post. Next I put the following lines in my global.asax: protected void Application_Start() { // kept same and added following line RegisterModelBinders(ModelBinders.Binders); // Add this line } public void RegisterModelBinders(ModelBinderDictionary binders) // Add this whole method { binders.DefaultBinder = new Microsoft.Web.Mvc.DataAnnotations.DataAnnotationsModelBinder(); } Now, I have made a partial class and a metadata class since I use the entity framework and you cannot create partial declarations as of yet so I have: [MetadataType(typeof(PersonMetaData))] public partial class Persons { // .... } public class PersonMetaData { private const string EmailRegEx = @"^(([^<>()[\]\\.,;:\s@\""]+" + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@" + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+" + @"[a-zA-Z]{2,}))$"; [Required] public string FirstName { get; set; } [Required] public string LastName { get; set; } [Required(ErrorMessage="Please fill in your email")] [RegularExpression(EmailRegEx,ErrorMessage="Please supply a valid email address")] public string Email { get; set; } } And in my controller I have the POST edit method which currently still use a FormCollection instead of a Persons object as input. I have to change this later on but due to time constraints and some strange bug this isnt done as of yet :). It shouldnt matter though. Below it is my view. // // POST: /Jobs/Edit/5 //[CustomAuthorize(Roles = "admin,moderator")] [AcceptVerbs(HttpVerbs.Post)] public ActionResult Edit([Bind(Exclude = "Id")]FormCollection form) { Persons person = this.GetLoggedInPerson(); person.UpdatedAt = DateTime.Now; // Update the updated time. TryUpdateModel(person, null, null, new string[]{"Id"}); if (ModelState.IsValid) { repository.SaveChanges(); return RedirectToAction("Index", "ControlPanel"); } return View(person); } #endregion My view contains a partial page containing the form. In my edit.aspx I have the following code: <div class="content"> <% Html.RenderPartial("PersonForm", Model); %> </div> </div> and in the .ascx partial page: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<WerkStageNu.Persons>" %> <% if (!Model.AddressesReference.IsLoaded) { %> <% Model.AddressesReference.Load(); %> <% } %> <%= Html.ValidationSummary("Edit was unsuccessful. Please correct the errors and try again.") %> <% using (Html.BeginForm()) {%> <fieldset> <legend>General information</legend> <table> <tr> <td><label for="FirstName">FirstName:</label></td><td><%= Html.TextBox("FirstName", Model.FirstName)%><%= Html.ValidationMessage("FirstName", "*")%></td> </tr> <tr> <td><label for="LastName">LastName:</label></td><td><%= Html.TextBox("LastName", Model.LastName)%><%= Html.ValidationMessage("LastName", "*")%></td> </tr> <tr> <td><label for="Email">Email:</label></td><td><%= Html.TextBox("Email", Model.Email)%><%= Html.ValidationMessage("Email", "*")%></td> </tr> <tr> <td><label for="Telephone">Telephone:</label></td><td> <%= Html.TextBox("Telephone", Model.Telephone) %><%= Html.ValidationMessage("Telephone", "*") %></td> </tr> <tr> <td><label for="Fax">Fax:</label></td><td><%= Html.TextBox("Fax", Model.Fax) %><%= Html.ValidationMessage("Fax", "*") %></td> </tr> </table> <%--<p> <label for="GenderID"><%= Html.Encode(Resources.Forms.gender) %>:</label> <%= Html.DropDownList("GenderID", Model.Genders)%> </p> --%> </fieldset> <fieldset> <legend><%= Html.Encode(Resources.Forms.addressinformation) %></legend> <table> <tr> <td><label for="Addresses.City"><%= Html.Encode(Resources.Forms.city) %>:</label></td><td><%= Html.TextBox("Addresses.City", Model.Addresses.City)%></td> </tr> <tr> <td><label for="Addresses.Street"><%= Html.Encode(Resources.Forms.street) %>:</label></td><td><%= Html.TextBox("Addresses.Street", Model.Addresses.Street)%></td> </tr> <tr> <td><label for="Addresses.StreetNo"><%= Html.Encode(Resources.Forms.streetNumber) %>:</label></td><td><%= Html.TextBox("Addresses.StreetNo", Model.Addresses.StreetNo)%></td> </tr> <tr> <td><label for="Addresses.Country"><%= Html.Encode(Resources.Forms.county) %>:</label></td><td><%= Html.TextBox("Addresses.Country", Model.Addresses.Country)%></td> </tr> </table> </fieldset> <p> <input type="image" src="../../Content/images/save_btn.png" /> </p> <%= Html.ClientSideValidation(typeof(WerkStageNu.Persons)) %> <% } % Still nothing really stunning over here. In combination with the edited data annotation dlls this gives me server-side validation working (although i have to manually exclude the "id" property as done in the TryUpdateModel). The strange thing is that it still generates the following script in my View: xVal.AttachValidator(null, {"Fields":[{"FieldName":"ID","FieldRules": [{"RuleName":"DataType","RuleParameters":{"Type":"Integer"}}]}]}, {}) While all the found blogposts on this ( 1, 2 ) but all of those are old posts and all say it should be fixed from xVal 0.8 and up. The last thing I found was this post but I did not really understand. I referenced using Visual Studio - add reference -- browse - selected from my bin dir where I stored the external compiled dlls (copied to the bin dir of my project). Can anyone tell me where the problem originates from? EDIT Adding the reference from the .NET tab fixed the problem somehow. While earlier adding from this tab resulted in a nullpointer error since it used the standard DataAnnotations delivered with the MVC1 framework instead of the freshly build one. Is it because I dropped the .dll in my bin dir that it now picks the correct one? Or why?

    Read the article

  • xVal 1.0 not generating the correct xVal.AttachValidator

    - by bastijn
    I'm currently implementing xVal client-side validation. The server-side validation is working correctly at the moment. I have referenced xVall.dll (from xVal1.0.zip) in my project as well as the System.ComponentModel.DataAnnotations and System.web.mvc.DataAnnotations from the Data Annotations Model Binder Sample found at http://aspnet.codeplex.com/releases/view/24471. I have modified the method BindProperty in the DataAnnotationsModelBinder class since it returned a nullpointer exception telling me the modelState object was null. Some blogposts described to modify the method and I did according to this SO post. Next I put the following lines in my global.asax: protected void Application_Start() { // kept same and added following line RegisterModelBinders(ModelBinders.Binders); // Add this line } public void RegisterModelBinders(ModelBinderDictionary binders) // Add this whole method { binders.DefaultBinder = new Microsoft.Web.Mvc.DataAnnotations.DataAnnotationsModelBinder(); } Now, I have made a partial class and a metadata class since I use the entity framework and you cannot create partial declarations as of yet so I have: [MetadataType(typeof(PersonMetaData))] public partial class Persons { // .... } public class PersonMetaData { private const string EmailRegEx = @"^(([^<>()[\]\\.,;:\s@\""]+" + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@" + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+" + @"[a-zA-Z]{2,}))$"; [Required] public string FirstName { get; set; } [Required] public string LastName { get; set; } [Required(ErrorMessage="Please fill in your email")] [RegularExpression(EmailRegEx,ErrorMessage="Please supply a valid email address")] public string Email { get; set; } } And in my controller I have the POST edit method which currently still use a FormCollection instead of a Persons object as input. I have to change this later on but due to time constraints and some strange bug this isnt done as of yet :). It shouldnt matter though. Below it is my view. // // POST: /Jobs/Edit/5 //[CustomAuthorize(Roles = "admin,moderator")] [AcceptVerbs(HttpVerbs.Post)] public ActionResult Edit([Bind(Exclude = "Id")]FormCollection form) { Persons person = this.GetLoggedInPerson(); person.UpdatedAt = DateTime.Now; // Update the updated time. TryUpdateModel(person, null, null, new string[]{"Id"}); if (ModelState.IsValid) { repository.SaveChanges(); return RedirectToAction("Index", "ControlPanel"); } return View(person); } #endregion My view contains a partial page containing the form. In my edit.aspx I have the following code: <div class="content"> <% Html.RenderPartial("PersonForm", Model); %> </div> </div> and in the .ascx partial page: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<WerkStageNu.Persons>" %> <% if (!Model.AddressesReference.IsLoaded) { % <% Model.AddressesReference.Load(); % <% } % <%= Html.ValidationSummary("Edit was unsuccessful. Please correct the errors and try again.") % <% using (Html.BeginForm()) {%> <fieldset> <legend>General information</legend> <table> <tr> <td><label for="FirstName">FirstName:</label></td><td><%= Html.TextBox("FirstName", Model.FirstName)%><%= Html.ValidationMessage("FirstName", "*")%></td> </tr> <tr> <td><label for="LastName">LastName:</label></td><td><%= Html.TextBox("LastName", Model.LastName)%><%= Html.ValidationMessage("LastName", "*")%></td> </tr> <tr> <td><label for="Email">Email:</label></td><td><%= Html.TextBox("Email", Model.Email)%><%= Html.ValidationMessage("Email", "*")%></td> </tr> <tr> <td><label for="Telephone">Telephone:</label></td><td> <%= Html.TextBox("Telephone", Model.Telephone) %><%= Html.ValidationMessage("Telephone", "*") %></td> </tr> <tr> <td><label for="Fax">Fax:</label></td><td><%= Html.TextBox("Fax", Model.Fax) %><%= Html.ValidationMessage("Fax", "*") %></td> </tr> </table> <%--<p> <label for="GenderID"><%= Html.Encode(Resources.Forms.gender) %>:</label> <%= Html.DropDownList("GenderID", Model.Genders)%> </p> --%> </fieldset> <fieldset> <legend><%= Html.Encode(Resources.Forms.addressinformation) %></legend> <table> <tr> <td><label for="Addresses.City"><%= Html.Encode(Resources.Forms.city) %>:</label></td><td><%= Html.TextBox("Addresses.City", Model.Addresses.City)%></td> </tr> <tr> <td><label for="Addresses.Street"><%= Html.Encode(Resources.Forms.street) %>:</label></td><td><%= Html.TextBox("Addresses.Street", Model.Addresses.Street)%></td> </tr> <tr> <td><label for="Addresses.StreetNo"><%= Html.Encode(Resources.Forms.streetNumber) %>:</label></td><td><%= Html.TextBox("Addresses.StreetNo", Model.Addresses.StreetNo)%></td> </tr> <tr> <td><label for="Addresses.Country"><%= Html.Encode(Resources.Forms.county) %>:</label></td><td><%= Html.TextBox("Addresses.Country", Model.Addresses.Country)%></td> </tr> </table> </fieldset> <p> <input type="image" src="../../Content/images/save_btn.png" /> </p> <%= Html.ClientSideValidation(typeof(WerkStageNu.Persons)) %> <% } % Still nothing really stunning over here. In combination with the edited data annotation dlls this gives me server-side validation working (although i have to manually exclude the "id" property as done in the TryUpdateModel). The strange thing is that it still generates the following script in my View: xVal.AttachValidator(null, {"Fields":[{"FieldName":"ID","FieldRules": [{"RuleName":"DataType","RuleParameters":{"Type":"Integer"}}]}]}, {}) While all the found blogposts on this ( 1, 2 ) but all of those are old posts and all say it should be fixed from xVal 0.8 and up. The last thing I found was this post but I did not really understand. I referenced using Visual Studio - add reference -- browse - selected from my bin dir where I stored the external compiled dlls (copied to the bin dir of my project). Can anyone tell me where the problem originates from?

    Read the article

< Previous Page | 1 2 3