
Image from Pexels
Tagged articles - ASP.NET
Found 89 articles tagged with ASP.NET
01
Nov
2021
Adding centralized secrets service to Azure Service Fabric cluster
PowerShell24 titlesAdding secrets store and using store secrets in Azure Service Fabric
0
Azure Service Fabric is a great platform to host services for your distributed solution. It allows you to easily deploy and scale your applications and services.
Apart from these out of the box functionalities which it is essentially build for, it also comes with secrets service which allows you to store and retrieve secret values for your application...read more
23
May
2020
Identifying opened connections for the specific application in SQL Server
SQL/T-SQL10 titlesConnection listing queries in SQL Server
0
Object relational mappers or ORMs are a great tool which can significantly reduce application development time, but if they are not use wisely they can cause bottlenecks and performance issues.
Same goes for dependency injection containers. The lifetime of the components, especially the ones that can cause recurse locks like SQL Server connections must be as short as possible and they should be released as soon as work is done.
...read more
02
Mar
2020
Overwriting configuration values with environment variable in ASP.NET Core
.NET229 titlesUsing environment specific variables to overwrite configuration values in ASP.NET Core
0
It is obvious that no matter what is the size and complexity of your application, configuration values on your local development machine and the environment where the application is going to run will be different. To avoid any hard-coding and recompilation of your code, the most common practice is to store application and environment specific values to configuration files...read more
31
Aug
2019
Handling file uploads in Swagger UI with ASP.NET Core
.NET229 titlesSwagger UI file upload in ASP.NET Core WebApi
0
Swagger is the most convenient way to document your REST api endpoints. It provides generating of documentation on the fly based on the code structure, which shortens the time of creating the documentation drastically...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
24
May
2018
Using Google reCAPTCHA v2 in ASP.NET Core Web Application
.NET229 titlesValidating data with Google reCAPTCHA v2 in ASP.NET Core using custom validation attribute
0
In case you have any page on your website which allows anonymous users to POST data to your web application, you should always use any kind of bot protection. Usually that is any kind of CAPTCHA implementation...read more
23
May
2018
Redis health check in ASP.NET Core WebApi
.NET229 titlesChecking availability of distributed Redis cache instances in ASP.NET Core WebApi
0
Even before popularity of micro service approach, for even monolithic applications you needed to have health-checks (Google Compute Engine) or health-probes (Microsoft Azure) for load balancing.
Basically in load balancing scenario, these endpoints are used to tell load balancer whether instance can handle requests or not. Since handling of requests may consider several components, these endpoints either return 200 OK HTTP response or any other response like 500 Internal Server Error with optional payload message describing the issue and each component status.
...read more
15
May
2018
Error handling in ASP.NET Core Web API
.NET229 titlesGenerating the proper response for exceptions in ASP.NET Core WepApi
0
Both Web API in .NET 4.5 and later and Web API in ASP.NET CORE have great error handling support out of the box. You can specify you global handler and control your response to a client when exception happens.
...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
07
Apr
2018
Simple implementation of ASP.NET Web API Basic authentication security
.NET229 titlesSecuring Web API with simple basic authentication and consuming it from the client code
0
Authentication in web services is a bit more different than with web pages because of one simple reason. There is no UI for entering credentials to authenticate to consume service...read more
13
Mar
2018
Displaying multiple select input for Enum in Swagger WebApi UI
.NET229 titlesMultiple select input Swagger WebApi UI
0
Enums in C# can contain multiple values if they are decorated with [Flags] attribute. However, Flag Enums are not recommended to be used in web api action method signatures...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
Mar
2018
Using WebP Images in APS.NET with a fallback to JPEG and PNG
.NET229 titlesWebP images in ASP.NET with fallback for browsers not supporting WebP
0
WebP is an image format introduced by Google Developers and it provides superior lossless and lossy compression for images on the web. Using WebP, webmasters and web developers can create smaller, richer images that make the web faster...read more
04
Mar
2018
Minify CSS and JavaScript files with PowerShell script
PowerShell24 titlesJavaScript and CSS file optimization with PowerShell script
0
Minification of Cascade Style Sheet (CSS) and Java Script (JS) should be on a TODO list for every web application. The minification of CSS and JS can be easily one on the runtime with ASP.NET bundling which is build in in ASP.NET framework, but in case of distributing your resource files over CDN you cannot use the runtime minification. You physical files need to be minified...read more
03
Mar
2018
Switch from HTTP to HTTPS in existing ASP.NET web application
.NET229 titlesSwitch complete traffic from unsecured to secured with web.config update
0
Starting from few years ago, Google enforces secured over unsecured website traffic. However it is an ongoing process since both publishers and advertisers need to implement HTTPS in order to avoid mixed contnet exception in a browser and preventing ads to load on a website.
...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