Tag Archives: ASP.NET
MVC 6 ASP.NET 5 full text search with Elasticsearch (dotnet .NETCoreApp 1.0 )
This tutorial shows how to create an MVC 6 ASP.NET Core application (dotnet .NETCoreApp 1.0) which does a full text search using Elasticsearch. This application uses jQuery-UI to send the search requests and ElasticsearchCRUD (pre-release version) to send the requests to Elasticsearch. ElasticsearchCRUD supports dnxcore50 and netstandard 1.4. The source code can be found in […]
Full Text Search with ASP.NET MVC, jQuery autocomplete and Elasticsearch
This article demonstrates how to do a full text search using jQuery Autocomplete with an ASP.NET MVC application and an Elasticsearch search engine. CRUD operations are also implemented for Elasticsearch ( ElasticsearchCRUD ). To download and install Elasticsearch, use the instructions here. Code: https://github.com/damienbod/WebSearchWithElasticsearch Other tutorials: Part 1: ElasticsearchCRUD introduction Part 2: MVC application search […]
Multiple ViewModels in a single MVC View
This post shows how to use multiple models in a single view. The models can be used in separated forms or together in one form. You could use each child model with a separate ajax post if required. Only properties in the parent class affect the child models, but a property in a child model […]
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 […]
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 […]
Simple MVC Application using standard Validation (DataAnnotations)
This is a simple example of standard MVC validation provided in the .NET framework. Create a new MVC application. Edit the index.cshtml file. Important: for client validation to work, the scripts section must be included. (Defined per default in the _Layout View and the BundleConfig.cs in the App_Start folder) Create a Model Edit the web.config […]
