Tagged articles
Image from Pexels

Tagged articles - .NET

Found 104 articles tagged with .NET

Adding extra info to an image file
Adding 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
Getting social network access token from C# backend
Acquire 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
Access auto property backing field with reflection
Access 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
Filesize to proper display string
Display 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
Optimizing LINQ expressions with anonymous types and methods
Advanced 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
Automatic property population when node created
Pre-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
Getting System.Drawing.Imaging.ImageFormat from a string
Get 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
Generating HTML string in C#
The 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
Enumerable Tips & Tricks with String and Int
Useful 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
Forcing accept type for WebApi call
Setting 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
Extending WebForms Page class for registering stylesheet include
Extension 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
Detecting request from mobile device
Take 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
Bitmap manipulation extension methods for C#
Helper 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
Simple configuration class
Adding 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

read more

JavaScript

read more

SQL/T-SQL

read more

Umbraco CMS

read more