.NET Programming

Articles related to .NET programming topics

Solving a Null Value When Posting a Simple String to a .NET Web API

The Problem: Many programmers, when creating a .NET Web API project, typically run into a situation where they want to post a simple x-www-form-urlencoded string datatype to an endpoint. They create the POST endpoint and attempt to post a string body to it only to find out that the value passed from the body is null. It can certainly be a frustrating endeavor to find a solution to this. After ...

ASP.NET Variables Won’t Hold Their Value

When it comes to working with ASP.NET most developers who have done standard desktop development always run into the problem of their class variables not retaining their values. You create a variable at the class/page level and expect that when you click a button or change a server control on the page that those variables will be there when its event is triggered. But in many cases they are not ...

Passing Data Between Forms – Using Delegates and Events

Back in an article I wrote in 2010 titled "Passing Data Between Forms in C# or VB.NET", I described one of a couple methods for passing data between two forms in a .NET forms project. One method was to publicly expose a method on a child form that the parent form could then call on when needed. At the same time I also mentioned, and advised against, using a public ...

A Game of Memory in VB.NET

One of the first projects that someone new to programming often wants to do is a game. Often times they want to do something they have seen on their consoles or mega computer games without realizing how much work actually goes into designing and implementing a game of that scope. After reading a book about programming they realize how tough those games are and that games of that scope usually ...

Serializing and Deserializing XML Through a URL Endpoint in C#

Recently, at the company I work for, I had to merge two very different web sites together. While both use C#, that is where they pretty much stopped in similarity. We were exploring ways to have them talk to one another very plainly and transmit only minimal amounts of data. One website was a store which was built around the idea of digital products and it had to talk ...

Quick Tutorial: Building Menus Dynamically With the MenuStrip Control in C#

One of the easiest ways to build a menu on Winforms is by simply dragging and dropping a MenuStrip control from the toolbox on your form and then go to town filling in menu text and attaching events. Most of the time this is the way to go and works for the majority of programs out there. What we will cover this time around is just a few examples of ...