Category Web
Turning off validation for properties in a MVC model
Sometimes it is required that some properties in a MVC model should not be validated, but the rest are required and should be validated in the client view. Mostly I cannot turn off client validation for all properties in the model. Here is an example of a Model class. I need to validate 2 properties […]
MVC Async File Upload
To use the upload html control inside an ajax request, the following steps need to be taken: Define an ajax function for the upload button Define the form for the upload Add the input file control to the form Handle the file in the MVC controller Return the json result, wrapped in a text item […]
WiX installer for MVC4 project
This example shows how a MVC4 solution can be setup together with a WiX installation project. To create a msi installer for a MVC4 project, the solution needs to be built, then the web project must be published, the WiX project harvests the published output and creates an msi installer. The solution is configured so […]
MVC real time Diagnosis using SignalR
UPDATED 2014.04.12: latest version of SignalR used and all other packages. The idea of this example is to create a simple SignalR service, so that all Log messages can be sent to a client browser in real time. In the example, EventSource classes are used to send the logs to the ETW. Semantic Logging OUT-OF-PROCESS […]
Validation in MVC, Enterprise Library, Fluent Validation, Data Annotations, FoolProof
MVC Validation MVC has many possibilities for validation. Depending on the use case, the correct validation should be used. Here is a list of MVC validation possibilities: Server side Model-level validation Server side Property-level validation Client side Model-level validation Server side Property-level validation Server side custom validation When validating, a number of problems can exist […]
Simple MVC Application using FluentValidation.MVC4
This is a simple example of MVC application using FluentValidation.MVC4. http://fluentvalidation.codeplex.com/ Create a new web application MVC4. Get the fluent validation using nuget: Create a validation rule set class: Now add the attribute to the model class: FluentDataModel Add the Provider to the Global.asax file App_Start() method And the validation works (Note: the dependency validation […]
