
Image from Pexels
Tagged articles - .NET
Found 104 articles tagged with .NET
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
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
28
Feb
2018
Export DataSet and DataTable to Excel with C#
.NET229 titlesSaving DataSet or DataTable instace to an Excel spreadsheet with C#
0
Some time ago I wrote an article on how to export data to Excel from C# code. Essentially it exports data to file which can be opened in Excel but it does not produce the actual Microsoft Office Excel document.
I recently wrote an article on Working with Excel files in .NET without using COM in C#, so I decided to use this approach to create extension methods for DataTable and DataSet classes...read more
28
Feb
2018
Export DataTable to HTML in C#
.NET229 titlesGenerate HTML table from DataTable instance in C#
0
When I searched for exporting s to HTML table in C# I found a lot of articles and code snippets which are basically doing string concatenation or String.Format on the hard-coded HTML String to generate HTML string of the table.
To me this approach is a bit like a workaround and I was never a fan of hard-coding values. In addition, code with a lot of hard-coded value end up as hardly maintainable code...read more
27
Feb
2018
Working with Excel files in .NET without using COM
.NET229 titlesRead and write Excel files with C# using OLEDB on x86 and x64 platforms
0
Excel is a common format for storing tabular data. It is a powerful tool from Microsoft Office package.
Since it is often format for string data, it is often required to work with this data from the third party applications...read more
25
Feb
2018
Simplest way to store lists and dictionaries in config files
.NET229 titlesFast and simple way of storing and using lists and dictionaries in config files
0
Configuration files are a useful place too keep any related configuration settings. It provides easy to use configuration fetching which you can invoke from any part of the application.
However it does not support many stuff out of the box, but on the other hand it is pretty flexible and expendable. One of the things that are not there built in is support for lists.
...read more
25
Feb
2018
Send data to Azure Log Analytics from C# code
.NET229 titlesSending data to Azure Log Analytics from your C# code
0
Azure as a part of Microsoft Operations Management Suite provides data collection and insight services inside Azure cloud platform.
It allows you to:
...read more
24
Feb
2018
Multiple file upload with ASP.NET WebApi
.NET229 titlesUpload multiple files using WebApi REST service
0
Taking out business logic from the application allows different clients running on a different platform to use same logic. REST API is a great way to decuple business logic and make it available to different clients on a different platforms. To upload files using WebApi we first need to define an action in a WebApi controller to handle files posted to the endpoint.
...read more
18
Feb
2018
Installing same Windows service under a different name
.NET229 titlesHow to install same Windows service with different name on the same host
0
Microsoft .NET framework comes with a really good support for Windows services. Regarding the project itself, Visual Studio IDE comes with build in project template for Windows service.
.NET framework itself comes with a built in tool installutil for deploying the Windows Service project...read more
18
Feb
2018
Sending email with Gmail account using PowerShell script
PowerShell24 titlesSend email with your Gmail account login with PowerShell script
0
Sending email after and even before a long running PowerShell script is a logical thing to do to notify users which are responsible for taking actions for the specific operation. PowerShell starting from version 3.0 has build in cmdlet Send-MailMessage for sending emails.
...read more
08
Feb
2018
Get .NET Framework version installed on Windows using PowerShell
PowerShell24 titlesHow to find out installed version of .NET Framework with PowerShell
0
Finding out installed .NET Framework version on the host Windows OS is not an everyday job, but when it comes to deployments of the .NET application it is needed to check if the host supports targeting .NET Framework version.
Starting from .NET Framework 4.5, Microsoft is storing .NET Framework version as a key in registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\Release
...read more
24
Jan
2018
Setting ASP.NET application on IIS always running with PowerShell
PowerShell24 titlesSwitch off AppPool timeout with PowerShell script
0
When creating new website with new application pool, bu default IIS sets your application pool in a way to save resources when inactive. This is because it does not want to run your website all the time if is there is no activity on it and keep using resources on the host for idle worker processes (w3wp.exe).
This is the reason you might experience slow response when opening your website URL from time to time especially if your website has low traffic.
...read more
22
Jan
2018
Concatenate list of strings in C# using LINQ
.NET229 titlesConcatenate list of string into single string using LINQ in c#
0
More often you will need a list of strings from a single string with a Split method, not so often you need to get a single string from an IEnumerable of strings, but still those requirements exist form time to time.
This does not look like a complex tasks, but still there are several ways to achieve this.
...read more
21
Jan
2018
Get number of messages in MSMQ with C#
.NET229 titlesMSMQ message count in .NET
0
MSMQ (Microsoft Message Queuing) is a built in Windows component. It is not so popular now days as there are more efficient and robust solutions available.
However, it still has it's place in application architecture as a simple queueing system, plus as I mentioned, it comes out of the box with Windows operating system as a Windows component.This means it is still widely used Windows based applications mostly for internal notifications and services between components of the solution...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