
Image from Pexels
Tagged articles - .NET
Found 104 articles tagged with .NET
19
Nov
2014
Adding extra info to an image file
.NET229 titlesAdding additional info to an image using C#
0
I was always wondering where are additional properties for the image stored. Simply, when you click right click on the image in Windows and go to properties, in tab Details there are some more info than just file size and image dimensions.
...read more
09
Oct
2014
Getting social network access token from C# backend
.NET229 titlesAcquire Facebook or Google+ access token from C# code
0
Most popular social networks such is Facebook and Google+ are providing authentication for web applications with fancy javascript pop-ups. However this approach might not work in all browsers and most likely not on every device.
For example this approach does not work on iPhone or iPad because browser itself does not allow pop-ups...read more
18
Sep
2014
Access auto property backing field with reflection
.NET229 titlesAccess property fields of auto property in C#
0
Using reflection you can easily access any property, filed, methods, pretty much anything of any type in .NET. Reflection is never the most elegant way to do something, but sometime you just have to do it.
In older versions of C#, to declare a simple property in a class you would have to declare a private field which will be exposed by the property outside the class
...read more
09
Sep
2014
Filesize to proper display string
.NET229 titlesDisplay size of file in the proper maner
0
How many times you had to display file size on your web page? Pretty much every time you might have the same issue with recalculating size to KB or MB.
I caught myself doing this for so many times over and over, so finally I decided to write a piece of code for that.
...read more
30
Aug
2014
Optimizing LINQ expressions with anonymous types and methods
.NET229 titlesAdvanced LINQ techniques
0
When LINQ was announced in .NET framework 3.5 I was a bit skeptic because it look a bit odd to me on the first look. Writing queries in C#, just did not look right to me.
Anyway, not all the things introduced in .NET had long life...read more
04
Aug
2014
Automatic property population when node created
Umbraco CMS25 titlesPre-populate properties right after node is created
0
For pretty much every website I built in Umbraco, there is some sort of title property for page document type. Either it is a title for navigation in breadcrumbs or menu or main h1 page title.
Usually some of these properties need to be mandatory and in most cases they are the same as the name of the node in content, but still, you have to keep ability to override the value with these properties.
...read more
15
Jun
2014
Getting System.Drawing.Imaging.ImageFormat from a string
.NET229 titlesGet ImageFormat based on file extension using Reflection
0
Images are part of pretty much any application especially web. Not so rarely they need to be protected or exposed from a different sources which cannot be accessed directly with just typing URL to it's actual location.
It all comes down to writing image bytes to an output stream...read more
07
Jun
2014
Generating HTML string in C#
.NET229 titlesThe proper way to generate html string in C#
0
From time to time you get to the point where you have to generate some HTML in C# code.
Of course, the easier way is to concatenate string and return that as a result of a method. This is not the most elegant solution and it is only fine for some short string.
...read more
28
May
2014
Enumerable Tips & Tricks with String and Int
.NET229 titlesUseful things to do with Enumerable in a single line
0
System.Linq.Enumerable is a core of LINQ magic.
Most of the functions we use in a daily basis for anything we write with sequence, but what is really interesting is that methods from this class can be used for some tricky operations on strings and numbers and make them one line instead of loops.
...read more
27
May
2014
Forcing accept type for WebApi call
.NET229 titlesSetting accept type on the server side for the WebApi request
0
One of the coolest things of WebApi is that adapts to accept type sent in request header. This header value depends on a client.
Based on this WebApi will serve different formats of data (XML/JSON).
...read more
27
May
2014
Extending WebForms Page class for registering stylesheet include
.NET229 titlesExtension method which enables registering stylesheet file reference
0
I recently started working on an Umbraco package for GoogleMap manipulation. Since initial version of package is planned only for Umbraco 6 I decided to use WebuserControl for creating a package custom datatype.
It means that for one document type I might have multiple control instances on the page.
...read more
28
Apr
2014
Detecting request from mobile device
.NET229 titlesTake control over what is and what is not mobile device for your web app
0
Microsoft made is easy to detect whether request to your web application is coming from mobile device or not by adding a property to Request class. Usage of this is Request.Browser.IsMobileDevice.
This works pretty fine for most of mobile devices, but this property is based on list of mobile browsers which is configured in .NET framework itself.
...read more
26
Apr
2014
Bitmap manipulation extension methods for C#
.NET229 titlesHelper methods for bitmap manipulation in .NET
0
This is a class I used few years back for some image manipulation in C#. Over the years, I was adding more methods and code snippets I needed and some stuff I found on Internet, so it grow to a useful collection of Bitmap manipulation methods...read more
23
Apr
2014
Simple configuration class
.NET229 titlesAdding configuration without having to restart app pool
0
Very often you need to store some settings in your configuration. Web.config files are designed for that but there are two things I found very annoying:
...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