Category jQuery
An alternative way to build and bundle Javascript, CSS in ASP.NET Core MVC and Razor Page projects
This article shows how Javascript packages, files, CSS files could be built and bundled in an ASP.NET Core MVC or Razor Page application. The Javascript packages are loaded using npm in which most Javascript projects are deployed. No CDNs are used, only local files so that all external URLs, non self URL links can be […]
MVC application with Entity Framework and Elasticsearch
This article demonstrates how to use Entity Framework with MS SQL Server as a primary database and Elasticsearch for the search/select functionality. The application combines the power and performance of Elasticsearch for search and fast selects and also Entity Framework for CUD transactions (Create, Update and Delete). Code: https://github.com/damienbod/WebSearchWithElasticsearchEntityFrameworkAsPrimary Other tutorials: Part 1: ElasticsearchCRUD introduction […]
MVC CRUD with Elasticsearch NESTED documents
This article demonstrates how to create Elasticsearch documents with NESTED objects using jQuery, jTable and moment.js in the MVC Razor View, and using MVC, ElasticsearchCRUD and Elasticsearch as the backend. The SearchController provides all CRUD Actions so you can experiment with the 1 to n entities, or the Elasticsearch nested documents. Not all Elasticsearch clients […]
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 […]
Loading a dynamic list in an ASP.NET Core MVC View
This example shows how to create a dynamic list in MVC application. An input event sends an ajax http Get to the controller, the data is created and sent back to the view. The input event uses the jquery.unobtrusive-ajax.js jQuery library to send the http Get to the server. Code: https://github.com/damienbod/MvcDynamicDropdownList History 2018-06-14 Updated to […]
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 […]