Tagged articles - C#
Found 167 articles tagged with C#
22
Aug
2014
Faking browser client in HttpWebRequest
.NET178 titlesIntroduce your request to server as a browser request
0
Using HttpWebRequest to fetch some data in your code from web is the easiest way to do it. However some web locations have restrictions to all only requests which come from browsers.
Performing a normal HttpWebRequest will return 403 status code (HTTP 403 - Wikipedia) which means forbidden access...read more
16
Aug
2014
Dictionary lists in Umbraco
Umbraco CMS25 titlesOut of the box solution for Dictionary lists in Umbraco
0
Umbraco implementation of localized values is based on Dictionary which is in settings section of Umbraco back-end. This works pretty fine in case you need to display only string values but does not work localized lists.
For example you might want to have country list for your contact form on your website...read more
14
Aug
2014
Using GoogleMaps Directions API to get accurate distance
.NET178 titlesExample of using GoogleMaps Directions API for calculating the distance
0
In situations where distance between two geo coordinates needs to be found most of the people are using mathematical function to do this. However there is a major disadvantage in using this method...read more
11
Aug
2014
Restrict Access to an MVC Action or Controller based on IP address
.NET178 titlesIP Address Filtering in MVC Controller
0
When you are developing a back-end web application, you might want to restrict access only to people who are working in the company which is maintaining the content or any other operations in the back-end and allowing public access only for the public, usually read-only content.
This means you still have to leave some parts of your application public and for some you need to restrict access for the people outside of a network (certain IP range).
...read more
07
Aug
2014
Best practice tips for large scale Umbraco websites
Umbraco CMS25 titlesExperience based tips for building large and complex websites in Umbraco
0
Umbraco is a great CMS, it simple, easily extendible and most important it is free.
However, it is not build for large scale websites, since presentation and back-end are on the same machine and all published content is stored in AppData/umbraco.config file. This is good because it can be easily cached and database read is reduced...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
03
Jul
2014
Synchronous vs asynchronous MVC controllers
.NET178 titlesAdvantage of using asynchronous over synchronous controller in MVC
0
Maybe you did not know but asp.net applications have limited number of threads available to process requests.
This value is set in your machine.config in configuration/system.web/processModel node. This file is located at
...read more
29
Jun
2014
Database Change Notifications in ASP.NET using WebSocket
.NET178 titlesDisplay database change on website in real-time
0
Database table changes are usually not displayed right away in an application, escecially if it is a web application. With HTML5 and Web API that is about to change...read more
25
Jun
2014
Using WebSocket in MVC4
.NET178 titlesReal time data update with MVC4 and HTML5 features
0
Ajax is really cool. You can pull your data without refreshing the whole page, but increasing user experience and downsizing bandwidth for website.
If you have some live data which is changing really often, the best way to display it on website is to use pulling mechanism...read more
16
Jun
2014
Returning an image in Web API method with fallback result image
.NET178 titlesHow to return an image in Web API method
0
Imagine the following scenario. You are building a social network like website and you need to create your own API to enable other developers to integrate with your web location really easy.
One of the things that most popular social networks now provide in the API is providing profile image...read more
15
Jun
2014
Getting System.Drawing.Imaging.ImageFormat from a string
.NET178 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
12
Jun
2014
Different data type in Web API response of the same method
.NET178 titlesBoth XML and JSON in return result of Web API REST service method
0
Web API restful services are very flexible and they return different data format (JSON or XML) depending on accept type header value from your browser (or other client).
However this is not always so precise so sometime you have to force return type. More on how to force return type on API method side itself you can find in this article...read more
10
Jun
2014
Aggregating RSS feeds from Umbraco content
Umbraco CMS25 titlesServing Umbraco website content in RSS format
0
RSS stands for Really Simple Syndication. It's an easy way for you to keep up with news and information that's important to you, and helps you avoid the conventional methods of browsing or searching for information on websites.
Umbraco stores it's published content in XML format, so exposing website data is really easy...read more
07
Jun
2014
Generating HTML string in C#
.NET178 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
06
Jun
2014
Serving embedded resources through WebAPI in Umbraco
Umbraco CMS25 titlesMake package deployment easy with single file deployment
0
Recently I've deploying GoogleMap Editor package to Umbraco community.
During development I realized that package will have to include script, some html templates, images... I had no problem with that but when it came to actual package build I realized that I will have to deal with bunch of files and even during development, so se some changes which were not dll related I had to restart app by touching web.config.
...read more
.NET
4
Feb
2019
How to have a REST with Azure serverless functions
Building REST API services with Azure Functions Serverless model
21
Jan
2019
Speech to text mp3 audio files using Azure Cognitive Services and .NET Core
Transcribe mp3 audio files to text using Azure SpeechServices and C#
4
Jan
2019
SqlBulkCopy object collection to database table with C#
Performing SqlBulkCopy with collection of objects as a source data
3
Jan
2019
Filtering and paging collection result in ASP.NET Core Web API
Paging response data in ASP.NET Core WebApi projects
30
Dec
2018
Running .NET Core on Raspberry PI with Raspbian Stretch
Setting up .NET Core on Raspbery Stretch Linux distribution running on Raspberry PI
15
Dec
2018
The best option to use for a return type in ASP.NET Core WebAPI controller
Choosing the proper return type for WebApi controller actions
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
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
13
Apr
2015
Dealing with duplicate rows in SQL Server
Finding and cleaning up duplicate rows in SQL Server tables
12
Mar
2015
Reducing the number of Stored Procedures for the Application
Approach to reduce number of stored procedure for the application
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