ASP.NET News from Blogger: Black Belt Coder Article Feed   Get the feed of: Black Belt Coder Article Feed

Total News: 24

Controlling JPEG Compression

The JPG graphics format supports varying level of compression and quality. Although it isn't readily visible, the Image.Save() method allows you to control this level. Here's a sample C# method that d...

Using Ajax.BeginForm() with ASP.NET MVC

ASP.NET MVC's Html.BeginForm() provides a handy shortcut for creating forms in your view. This article describes using Ajax.BeginForm(), which brings the same type of shortcut for implementing forms t...

Calling Web Services Using AJAX

This article presents code that uses AJAX to contact the server from client-side script and get a response without refreshing the current page....

Quick and Easy Method to Remove Html Tags

Here's a short snippet of code you can use to strip out HTML tags from a block of text....

Recursively Finding Controls

ASP.NET Web Form controls provide the FindControl method for finding child controls. However, FindControl does not find child controls of child controls. So here's a simple extension method that will ...

Dynamically Populating Controls using AJAX

This article demonstrates how to populate a control from JavaScript by calling a server-side method. The server-side method returns the data (from a database or anywhere else), which the JavaScript us...

Reading and Writing CSV Files in C#

An easy way to share data with programs like Microsof Excel is to read and write Comma-Separated Values (CSV) files....

Easy Full-Text Search Queries

SQL Server's Full-Text Search offers a powerful and efficient way to search your data. However, the Full-Text Search syntax can be rather cryptic, especially for unsuspecting users. Here's a class tha...

A JavaScript Formatter

JavaScript that has been compressed to use less bandwidth can be very difficult to read. Here's a C# class that will format JavaScript code, making it easy to read again....

Generating a <machineKey> Element

Here's some code that generates a random machineKey element suitable for pasting into your ASP.NET web.config file....

A DoubleClick Custom Web Control

Here's a custom web control that makes it very easy to display Google DoubleClick for Publisher (DFP) ads on an ASP.NET website....

Enabling RSS Auto Discovery

RSS autodiscovery is a technique that allows browsers and other software to automatically detect any RSS feeds associated with a particular website....

Converting Between Integers and Strings Using Any Base

.NET provides the Convert class, which among other things can convert between integers and strings using different bases. Inexplicably, the Convert class only supports base 2, 8, 10 and 16. Here's a c...

Convert HTML to Text

I recently wrote about converting plain text to HTML. Here's some code to convert HTML back to plain text. This code should come in handy for any situation where you need to extract plain text from th...

Converting Text to HTML

Here's a simple routine that will format a string as HTML so that it can be displayed on a web page. It extends the functionality offered by the HttpUtility.HtmlEncode() method....

An ADO.NET SQL Helper Class

Technologies like Entity Framework are cool, but accessing ADO.NET directly is still a little faster. For developers still using plain old ADO.NET to query SQL Server databases, here's a helper class ...

A C# Command-Line Parser

.NET applications can use Environment.CommandLine to access any command-line arguments that were supplied to the program. However, there's more work to do if your command line support many options. He...

An FtpClient Class and WinForm Control

The .NET Frameworks provide a rich assortment of classes for dealing with the Internet. However, piecing together working FTP code can be time-consuming. Here's a ready-made FTP client class, along wi...

Programmatically Resizing an Image

The .NET frameworks make it easy to resize an image programmatically. Here are some routines I used on a website to process avatars uploaded by users....

Parsing Tokens with Extension Methods

Extension methods are a cool new feature of C#. This article describes extension methods and presents a sample for the String class that can be used to parse tokens....

A Self-Closing HtmlGenericControl

An easy way to add HTML controls to your webform at runtime is to use HtmlGenericControl. However, this class always renders both an opening and closing tag. This article presents a version that is se...

A sscanf() Replacement for .NET

C and C++ developers have used the sscanf() function for many years as a quick and easy way to parse well-structured input. Here's a class that brings the same functionality to .NET....

Fast Text Search with Boyer-Moore

This article describes the Boyer-Moore exact pattern matching algorithm, presents C# code that implements the algorithm, and then tells you why you probably should not use the code....

A SQL QueryBuilder Class

Use the QueryBuilder class to programmatically create SQL queries. This article also discusses the pros and cons of such an approach....

View Other bloggers