
Image from Pexels
Tagged articles - MVC
Found 40 articles tagged with MVC
28
Nov
2019
Using options pattern in MVC5 legacy applications with web.config
.NET229 titlesSimple implementation of options pattern in .NET Framework 4.x legacy applications
0
The story behind New descendant of .NET Framework, .NET Core, comes with one really useful pattern for reading and using configuration files. It comes with out of the box support for JSON configuration files which are much more readable and give much greater freedom and flexibility on how to organize your settings...read more
03
Jan
2019
Filtering and paging collection result in ASP.NET Core Web API
.NET229 titlesPaging response data in ASP.NET Core WebApi projects
0
Paging a REST API response is equally important as filtering the data returned through REST API endpoints and they quite often come together. Just like filtering, paging limits the amount of data returned from the endpoint, saving both client and server side resources...read more
15
Dec
2018
The best option to use for a return type in ASP.NET Core WebAPI controller
.NET229 titlesChoosing the proper return type for WebApi controller actions
0
Starting from .NET Core version 2.1, there are so far three types of WebApi responses that controller actions can return. All three types had it's own pros and cons but all are lacking in options to satisfy both REST and the high level of testability. The available response types in ASP.NET Core including recently released 2.2 version are
...read more
10
Oct
2018
Extending Serilog with additional values to log
.NET229 titlesAdding additional information to log in .NET Core application with Serilog
0
If you are building .NET Core application your choice for logger library is most likely Serilog. It is really powerful and easy to use library which allows you easy logging in all levels in your application.
One of the best features it has is easy extending of the data you want to have in your logs...read more
08
Sep
2018
Reloading the cache automatically once expired is ASP.NET MVC
.NET229 titlesLoad values to in memory cache as soon as they expire in ASP.NET MVC
0
In memory caching is not a bullet proof way of caching data in an application, especially if this application is distributed. The lack of synchronization between nodes can cause you application to misbehave showing wrong data or even throwing exceptions and crashing. This is one of the main reasons why distributed caching is the best way of doing the caching in your web application.
But not all applications you might be developing need to run as distributed on multiple machines...read more
14
Aug
2018
Minify ASP.NET MVC Core response using custom middleware and pipeline
.NET229 titlesHtml response content minification on the fly in ASP.NET Core
0
For my website, since it runs on Umbraco 6 and it is basically ASP.NET MVC application. To reduce load time and increase website performances I decided to alternate the response of the application and minify it using simple regular expression.
Initially I was trying to do this with YUI Compressor library which has .NET port as NuGet YUICompressor.NET which works fine in most of the cases, but in my case does not skip PRE tags which I use for code snippets on the website...read more
04
Aug
2018
Simple pixel conversion tracking implementation in ASP.NET Core WebApi
.NET229 titlesConversion tracking implementation using pixel method in ASP.NET Core
0
Pixel tracking, although it is the oldest method for tracking conversions in marketing, it is still used widely and some big companies like Facebook are still overing it as one of the methods for tracking the conversions of on your web pages. Tracking conversion via pixel method is still widely used because of it's simplicity...read more
02
May
2018
Generic string to primitive type converter in C#
.NET229 titlesConverting string data to any primitive type in .NET and .NET Core
0
Often case when you need to convert String to a different type which is most of the time a primitive type in C# is when you are reading values from configuration. In both .NET and .NET Core, reading from configuration return plain String value...read more
08
Mar
2018
Handling Cross-Site Scripting (XSS) in ASP.NET MVC
.NET229 titlesHandling XSS in ASP.NET MVC with custom Razor Html helpers and HttpModule
0
Cross-site Scripting (XSS) refers to client-site code injection attack where an attacker can execute malicious scripts into a web application. Basically attacker manages to upload malicious script code to the website which will be later on served to the users and executed in their browser...read more
07
Feb
2018
Reasons for ASP.NET application restarts on IIS server
.NET229 titlesCommon reasons for causing ASP.NET web applications to restart
0
If you were experiencing you ASP.NET Web Application to restart, there are few possible reasons for that, but before we jump to resons why ASP.NET web application hosted on IIS gets restarted let's first look at the relation between IIS and ASP.NET
...read more
09
Oct
2017
QR code MVC html helper
.NET229 titlesDisplay runtime generated QR code in MVC page
0
This article is based on one of my previous topic Advanced Base64 image extension in ASP.NET MVC. It uses the same concept to display image on the page and to cache it, but it involves QR code bitmap generation which is basically a NuGet package use.
Basically, QR code is generated using NuGet package QRCoder https://www.nuget.org/packages/QRCoder/ and result Bitmap is serialized to base64 string and cached so we do not regenerate same QR bitmap over and over on every request which may lead to server overload.
...read more
13
May
2017
Advanced Base64 image extension in ASP.NET MVC
.NET229 titlesAdvanced base64 image rendering in a Razor in ASP.NET MVC
0
Serializing images to base64 string is well known technique to reduce requests per page. Each image on the page produces a separate request while page is loading...read more
12
May
2017
ASP.NET Core Web API versioning
.NET229 titlesSimple way to setup versioning in ASP.NET Core WebAPI
0
When it comes to WebAPI many project overlook the versioning aspect. The whole concept of WebAPI is to serve multiple types of clients which can be based on different platforms, run on different devices etc...read more
26
Apr
2017
Inline JavaScript and CSS tags with ASP.NET MVC
.NET229 titlesRendering inline JavaScript and CSS tags in document in MVC
0
With ASP.NET MVC Microsoft introduced bundling of JavaScript and CSS resources. These bundles work pretty well but to me it always looks not so natural to define bundles in BundleConfig.css and I had problems if I want to edit CSS or JavaScript during runtime because they are cached...read more
18
Jan
2017
Why is JsonRequestBehavior needed?
.NET229 titlesUnderstanding JSON data restriction over HTTP GET requests
0
You probably run to this exception when you tried to fetch JSON data over HTTP GET request. Now, first this is easy to bypass by simply adding JsonRequestBehavior.AllowGet option to method which is retutning JSON data for GET request in a controller file.
...read more
.NET
5
Jun
2022
Using dotnet nuget package vulnerability scan in Azure DevOps build
Listing nuget vulnerabilities and controlling build in Azure DevOps
5
May
2022
Protecting static files in ASP.NET Core using custom middleware
Restricting access to specific static content with middleware in ASP.NET Core
20
Dec
2021
Supporting multiple authentication schemes in asp.net core webapi
Using more than one authentication schemes in webapi projects
12
Dec
2021
Controlling the flow of migrations in EF Core
Altering EF Core migrations execution order
28
Nov
2021
Unit of work pattern with Dapper
Implementing unit of work pattern with Dapper in .NET 5
21
Sep
2021
Adding display name to Enum values
Implementing additional values for Enum items in C#
JavaScript
28
Oct
2018
HTML5 localStorage with expiry with vanilla JavaScript
Using HTML5 localStorage with expiry
8
May
2018
Monitoring DOM changes with JavaScript
Handling DOM changes with plain JavaScript
9
May
2017
Non blocking CSS load on the page
Load external CSS files in an async manner
16
Mar
2017
Serialize html form to JSON without using JQuery
Transform user input from HTML form fields to JSON
17
Jan
2016
Copy text value to clipboard using jQuery
Simple sample of using jQuery to copy value to clipboard
11
Jan
2016
Resize image on the client side with JQuery
Reducing the upload sie by resizing image on the client side
SQL/T-SQL
22
Feb
2022
Select column names with values from SQL Server database
Fetching column names with its value in T-SQL using built in JSON methods
23
May
2020
Identifying opened connections for the specific application in SQL Server
Connection listing queries in SQL Server
3
May
2018
Reading JSON data in T-SQL on SQL Server
Extracting values from JSON string on SQL Server using T-SQL
28
Apr
2016
Create XML/HTML with T-SQL
Generating XML/HTML output in SQL Server
24
Nov
2015
IP address to octets split in TSQL
Split IP addresse into octets in SQL Server
20
Jul
2015
Getting first and last second of the current year, month and day
Using minimum and maximum date time in SQL query
Umbraco CMS
2
Mar
2018
Minify HTML output of your pages
Minification of HTML output using ASP.NET IHttpModule
18
Apr
2015
Generate sitemap.xml on the fly in Umbraco CMS
Simple sitemap.xml Umbraco handler
2
Mar
2015
Accessing UmbracoHelper in HttpHandler request
Working with UmbracoHelper and IPublishedContent in HttpHandler
14
Sep
2014
Same page language switching in Umbraco
Land on the same page in different language in Umbraco using Relations
4
Sep
2014
Getting cropped image the smart way
The way to get cropped image URL with option to load original image too
27
Aug
2014
Fastest way to return JSON result from a controller
Resturn JSON in MVC controller action