Articles and Papers by Rick Strahl
This is an summary archive of links to articles, white papers and in depth blog posts I've published since the late 90's. This list does not include everything, but everything is occasionally culled to remove content that is no longer relevant or obsolete. Enjoy.
A WebAPI Basic Authentication Authorization Filter
April 20th, 2013
Security is a requirement in most Web applications and ASP.NET WebApi is no exception. Recently I needed to implement user based security in a WebApi application that's easily accessible from a variety of clients and the request was specifically for Basic Authentication support. In this article I describe a simple AuthorizationFilter based implementation of Basic Authentication for ASP.NET WebApi.
Using plUpload to upload Files with ASP.NET
March 12th, 2013
plUpload is a popular client side multi-file upload component. In this article I describe a small library that abstracts the server side processing of uploaded files with an ASP.NET HTTP handler and demonstrate putting it all together with a small Image Upload sample Web page.
Building a better .NET Application Configuration Class
December 28th, 2012
Application configuration is a key feature for application customization and adaptability and .NET provides some fairly decent built-in support for configuration management. Personally however I prefer a code-first approach to configuration management and so I've long ago created a custom component to handle configuration using strongly typed .NET classes that can read and write configuration data from various data stores. In this article I describe the built-in features in .NET and then demonstrate the Westwind ApplicationConfiguration component to show how configuration management in your apps can be even easier.
WCF WS-Security and WSE Nonce Authentication
November 24th, 2012
WS-Security is built into WCF, but it's quite common to have Web Services that require Nonce Authentication using the WSE protocol that WCF does not natively support. In this article I review how to use WS-Security with WCF and how you can customize the headers to provide Nonce/WSE support for your service client.
Using JSON.NET for dynamic JSON parsing
August 30, 2012
Parsing JSON dynamically rather than statically serializing into objects is becoming much more common with today's applications consuming many services of varying complexity. Sometimes you don't need to map an entire API, but only need to parse a few items out of a larger JSON response. Using JSON.NET and JObject,JArray,JValue makes it very easy to dynamically parse and read JSON data at runtime and manipulate it in a variety of different ways. Here's how.
An Introduction to ASP.NET Web API
August 19, 2012This article is a practical introduction and hands on overview of ASP.NET Web API. From the basics of setting up a new API Controller to calling the service via AJAX calls to handling errors, dealing with model binding this article serves as tour of the core features of Web API by example.
Creating STA COM Components in ASP.NET
August 15, 2012
If you still have to use STA COM components with ASP.NET you'll find that other than WebForms STA COM support in ASP.NET is non-existant. If you want to use MVC, Web Services or WCF natively you'll find they all run with MTA and have no easy mechanism to allow STA components to run reliably. In this article I show how you can create STA compatible handlers for MVC and ASMX and WCF Web Services.
Calling .NET Components from Visual FoxPro using wwDotnetBridge
October 25, 2012
.NET is here to stay, and you can take advantage of the rich functionality in the .NET framework from Visual FoxPro. You can access code in the .NET framework as well as Microsoft, third party and your own .NET libraries. This article expands on my previous COM interop articles and introduces the open source wwDotnetBridge library that lets you instantiate and interact with most .NET types directly from Visual FoxPro code. It's a great way to extend Visual FoxPro's reach as well as allowing FoxPro developers to create their own .NET components that can be interacted with from FoxPro.
Calling FoxPro COM Components from ASP.NET Revisited
October 25, 2012If you need to call FoxPro COM components from ASP.NET recent changes in .NET 4.0 have made this process a bit easier. This article expands on how to create FoxPro COM components in .NET and ASP.NET in particular by using more modern technologies like ASP.NET MVC and Web Services to call FoxPro COM Components taking advantage of the Dynamic language improvements in .NET that make it much easier to consume FoxPro COM components.
.NET HTML Sanitation for rich HTML Input
July 19, 2012Securing HTML input from users in Web applications is a thorny subject, but there are not many good solutions out there for .NET. In this article I describe an HTML sanitation scenario and a custom solution I used to allow posting of relatively rich HTML on a Web site.
Accessing Spatial Data with SQL Server and Entity Framework 5.0
June 20, 2012Spatial data has been available for a while in SQL Server, but if you wanted to use it with Entiry Framework you had to jump through some hoops. In this article I show how basic SQL Spatial data works and then how you can utilize the new features in EF 5.0 and later to directly access spatial data using your CodeFirst models.
Rendering ASP.NET Views to String
May 30th, 2012Creating templated text output that's not tied to the HTTP output stream is a frequent requirement in many applications. Rendering confirmation emails, password resets, validations and notifications all generate text through templates that require string or stream output that doesn't get sent to HTTP. In this article I show a few helpers that make it easy to create string output from MVC Views.
Creating JSONP Formatter for ASP.NET Web API
April 2nd, 2012Web API doesn't include native JSONP support, but it's pretty easy to create a custom formatter that handles this task. Here's how to create a JsonpFormatter and hook it up as well as a short review of how JSONP works.
Creating a dynamic, extensible C# Expando Object
May 30th, 2012Dynamic types in .NET make it very easy to create custom types in .NET. In this article we'll look at using a custom dynamic type that can extend an existing type at runtime with dynamic properties and methods.
Using the HTML5 <input type="file" multiple="multiple"> Tag in ASP.NET
March 6th, 2012Upload controls in HTML are a pain, but HTML5 at least allows for multiple files to selected from the file picker to effectively upload multiple files from a single control. Here's how you use the HTML5 control and how you handle receiving the files in ASP.NET.
Debugging Application_Start and Module Initialization with IIS and Visual Studio
December 15, 2011If you're running the full version of IIS and you try to debug your Web application's startup code in Application_Start you might have found that you can't debug this code as the debugger doesn't break there. Here's why and some easy ways you can work around this limitation.
A Key Code Checker for DOM Keyboard Events
Creating a Dynamic DataReader for easier Property Access
December 3rd, 2011How do you display editable time values in Web applications? While date display has a pretty clear UI choice with date pickers, visual time picking isn't very efficient. In this post I show a keyboard based alternative to navigating and entering time (and date values) values using hotkeys hooked up through a jQuery plugin.
jQuery Time Entry with Time Navigation Keys
November 30th, 2011How do you display editable time values in Web applications? While date display has a pretty clear UI choice with date pickers, visual time picking isn't very efficient. In this post I show a keyboard based alternative to navigating and entering time (and date values) values using hotkeys hooked up through a jQuery plugin.
Using the West Wind Web Toolkit to set up AJAX and REST Services
Create Side by Side registrationless COM Manifests with Visual Studio
October 9th, 2011Registrationless COM makes it possible to run COM components without registry configuration making for an xCopy deployable solution. The process is not terribly difficult but not easy to debug if something goes wrong. Here's how you can use registrationless COM in your apps.
An Xml Serializable PropertyBag Dictionary Class for .NET
October 9th, 2011.NET includes many Dictionary related types but serialization of Dictionaries leaves a lot to be desired. In this post I show how to create a serializable PropertyBag class that makes it easy to XmlSerialize arbitrary key/value pairs into XML and back.
Web Browser Control – Specifying the IE Version
May 21st, 2011The Web Browser control's default rendering mode is not very standards compliant - it's stuck in IE 7 quirks mode which is less than ideal for any HTML preview operations. It also fails to display the latest CSS and HTML 5 enhancements of IE 9. Luckily there's a workaround via some registry hacks that you can add to make your application render the Web Browser control using a specific version of IE.
Custom ASP.NET Routing to an HttpHandler
March 28th, 2011Routing support in ASP.NET 4.0 has been vastly improved, but custom routing still involves a fairly complex process of creating RouteHandlers and mapping requests properly. In this post I show an example of how to create custom routes automatically via Attribute route mapping for Http Handler endpoints.
A jQuery Plug-in to monitor Html Element CSS Changes
Hosting the Razor Engine for Templating in Non-Web applications
December 28, 2010Microsoft's new Razor View Engine is now available with WebMatrix and MVC 3 and the good news is that the engine can be easily and efficiently hosted in non-Web applications. In this article I'll discuss a library that makes it easy to embed Razor based templating into your own applications and in the process describe how Razor hosting works.
Making Sense of ASP.NET Paths
January 10, 2010ASP.NET includes a plethora of functions and utilities to retrieve information about the current requests and paths in general. So much so that it's often hard to remember exactly which path property or method you are actually looking for. This article summarizes many of the paths and path related operations that are available in ASP.NET.
A free standing ASP.NET Pager Web Control
December 18, 2009ASP.NET includes several controls that support paging but they vary fairly drastically for different controls and can't be controlled purely by assignment. This article discusses the shortcomings of native paging in ASP.NET and introduces a free standing pager control that is generic and works without dependencies on DataSource or other specific ASP.NET controls and provides SEO friendly navigation.
Capturing and Transforming ASP.NET Output with Response.Filter
November 13th, 2009Capturing ASP.NET response output can be done in a variety of ways. In this article I discuss how you can use a Response.Filter to capture output and transform it using a simple class that provides event hooks to make it easy to capture and transform output generically.
Integrating OpenID in an ASP.NET MVC Application using DotNetOpenAuth
September 17th, 2009OpenId is getting more popular and with it come requests to integrate it into Web sites as a user authentication mechanism. In this article I give an overview of what OpenId is, how it works and demonstrate implementing it in an MVC Web application using the DotNetOpenAuth toolkit with a detailed walk through of the integration code.
Making jQuery Calls to WCF/ASMX with a ServiceProxy Client
September 10th, 2009This article describes a self-contained mechanism for calling WCF/ASMX services using only the jQuery client library and a bit of custom code by providing a reusable ServiceProxy class that makes calling service methods as easy as a single method call.
WPF Localization Guidance
July 1st, 2009This article introduces the core localization features in the .NET framework relevant for WPF as well as specific localization approaches supported for WPF. Covered are the static and rigid approach using LocBaml as well as a couple of approaches using a Resx markup extension or using a more Windows Forms based approach using attached properties. This article is hosted on the CodePlex site as a downloadable Microsoft Word document.
Creating Visual Studio Project Templates from your Web Projects
April 27, 2009Visual Studio provides an easy way to create project templates from an existing project and this makes it real easy to create custom project types that are tailored to the way that you work.
A .closeable Plug-in for jQuery
April 14, 2009Sometimes you just want to close DOM elements and this little plug-in provides an easy way to display an icon, handle the closing of the item and allow for handler to fire in response. Simple reusable functionality and a small, useful example of jQuery plug-in development.
Using Enums in ASP.NET List Controls
February 20, 2009Sometimes it can be handy to display data from Enum values in lists in the user interface as a quick way to present pick lists, especially in administration interfaces. Here is how you can load up enum values in DropDown lists along with some ideas on when this practice does and does not make sense.
Monitoring HTTP Output with Fiddler in .NET Clients and Proxies
January 14th, 2009When working with HTTP clients or Web Services being able to capture HTTP output is crucial. HTTP monitors are invaluable in this process and using them with .NET clients requires some special care. Here's what you need to know.
jQuery and ASP.NET (Part 2: Making Ajax Callbacks to ASP.NET)
December 3, 2008Part 2 of this series introduces focuses on connectivity between the jQuery client and ASP.NET server. This article discusses the Ajax functionality available in jQuery and demonstrates a variety of ways on how to retrieve data from the server and use on the client with jQuery. Topics covered using .load() with external content, making Page callbacks with HTML fragments and JSON results and using WCF and ASMX service to create raw Ajax applications that only consume server data.
An Introduction to jQuery (Part 1: The Client Side)
Digitally signing and validating an XML Document
March 1, 2008This article describes the complete process of signing an XML document with a private 7key certificate, and then validating the same document with the public key. The includes step by step instructions including creating a test certificate and installing it and how to use the certificate from your code for signing and validation. It also covers installation of a full certificate from a qualified CA which is a slightly different process. A sample class that works with any SOAP Envelope XML document is provided to demonstrate.
Setting up and running Subversion and Tortoise SVN
August 9, 2007This article is a quick start step by step guide for setting up Subversion for Source Control and using Tortoise SVN to set up and manage your repository and local copies of projects. This article uses a Visual Studio Solution as an example, but the same concepts can be applied to any tool or set of files for that matter. The article discusses installation and setup, creating of a repository, creating local copies and basic day to day operations.
Creating a data driven ASP.NET Resource Provider & Editor
July 7, 2007Find out how to build an ASP.NET 2.0 Resource Provider that uses database data for its localization storage rather than Resx files. Database resources can be much more flexible and this article demonstrates how to build a powerful ASP.NET resource editing front end that allows editing of resource data in a live ASP.NET application in a context sensitive manner.
Introduction to Localization in ASP.NET 2.0
July 2, 2007Check out the localization features in ASP.NET 2.0 and understand how they work under the covers. This introduction focuses on the ASP.NET 2.0 specific technology for localization and discusses how Resource Providers are used to provide the various integrated localization features in ASP.NET 2.0 and Visual Studio .NET. The focus of this article is on the technology rather on the deep semantics of localization. Serves as an introduction for the Resource Provider article.
Create a Screen Capture Plugin for Windows Live Writer
March 25, 2007This article demonstrates how to build a Windows Live Writer plugin that allows for embedding screenshots into the current Blog entry being edited. The article describes the basics of content plugins for Live Writer and uses a plugin that uses SnagIt from Techsmith to provide an easy and flexible way to do screen captures directly into your blog content using C# code...
Calling and Hosting FoxPro Web Services through .NET
January 9th, 2007Web Services with Visual FoxPro have always been problematic with Visual FoxPro especially if dealing with services that publish complex types. The most common Web Service tool for FoxPro is the SOAP Toolkit which has been discontinued and has a host of problems dealing with complex types. In this article I discuss how you can leverage .NET to make Web Service calls from Visual FoxPro and how to host Visual FoxPro components in .NET Web Services. The article also demonstrates how to use Windows Communications Foundation (WCF) for the same tasks.
Creating a two-way data binding Extender Control for ASP.NET 2.0
November 15, 2006As much as ASP.NET 2.0 improves data binding, one aspect - simple control binding for controls like textboxes, checkboxes and selected values of lists for example - is still tedious especially when it comes to unbinding data. This article demonstrates a powerful extender control that can provide easy to use two-way databinding semantics. Using the control you can easily bind and unbind any control properties to any data field or property of an object with full control over binding, unbinding and dealing with binding errors at runtime. The article demonstrates the control functionality and discusses the design of building an ASP.NET 2.0 extender control that provides the flexibility to extend any existing controls on a Page, Master Page or User Control. Article is published on MSDN
Integrating Electronic Payment Processing into ASP.NET
April 11th, 2006Find out to integrate Credit Card processing into your ASP.NET applications. This long article starts at the beginning discussing how the actual payment processing works from the provider level and delves into details with specific implementations for several common gateway services and a set of classes you can use for payment processing. Finally an example shows how to integrate these classes in a live application.
Advanced FoxPro COM Interop Article Series
December 26th, 2005Are you using COM Interop from Visual FoxPro to communicate with .NET? This series of articles takes you through some of the scenarios you are likely to run into once you go beyond the basics of calling simple COM objects and show more sophisticated .NET functionality that you can take advantage of in your FoxPro code with a little extra work.
A low-level Look at the ASP.NET Architecture
July 18th, 2006Ever wonder how requests get into the ASP.NET pipeline from IIS? Find out about the low level plumbing of ASP.NET starting with a detailed discussion of how requests route from IIS, through the ASP.NET ISAPI extension into the ISAPRuntime and finally into the ASP.NET pipeline for HttpApplication processing with Http Modules and Handlers. This article takes a on the low-level aspects of ASP.NET for those that want to understand the inner workings of the framework.
Building a better Application Configuration Settings Class
July 18th, 2006NET provides rudimentary support for storing and retrieving configuration settings out of .config files. But there are a number of important features missing. Find out how to build a better mousetrap by creating a class that provides strong typing, read/write capability and encryption for values stored in your configuration files.
Using Unicode in Visual FoxPro Web and Desktop Applications
July 18th, 2006Visual FoxPro doesn’t have native Unicode support which means that you have to do some extra work and understand how the process works in order to work with it. In this article I’ll describe the issues in the context of supporting of multiple languages simultaneously, rather than through the view of code page translation which Visual FoxPro readily supports. I’ll start with an overview of the issues and how to work with Unicode in general, then show how to retrieve and update Unicode data using Visual FoxPro and SQL Server data. Finally I'll talk about how to get the Unicode content to display both in your Web and Desktop user interfaces.
PayPal Integration into e-Commerce Solutions with ASP.NET
September 19th, 2004PayPal provides one mechanism to process payments on the Internet. While it's not the first choice for payment processing for typical e-Commerce sites it does provide additional choices for those customers that don't feel comfortable paying by credit card over the Web. It's also an easy solution for first time Shop owners who might not want to invest in a full merchant account. This article describes PayPal integration from the perspective of a full featured e-Commerce application and focuses on integrating PayPal seamlessly into this environment. The article also provides a PayPal helper class (ASP.NET/C#) and a skeleton sample application that demonstrates the process and makes it easy to hook your own code into. Although the code provided is .NET, the concepts in this article apply to any Web development environment.
Calling .Net Web Services for Data Access from Visual FoxPro
July 7th, 2004Find out how to create a .Net Web Service that serves up data in a variety of ways, then see how to consume this data with Visual FoxPro. .Net Web Services are easy to develop, debug and deploy, but consuming the data, especially with Visual FoxPro is not always as straight forward as you think. This article discusses how to pass complex data between .Net Web Services and Visual FoxPro and provides several tools to facilitate and standardize the process of building solid Web Service clients for your applications.
Building a Web XML Data Service with Visual FoxPro
March 5th, 2004Have you ever wanted to build a remote data access mechanism into an application where you can talk to data that is coming over the Web rather than from a local or network data source? Wouldn’t it be cool if you simply pointed at a URL and could remotely execute some SQL code and return data to you on the client? In this article Rick shows how to build a generic Web Sql data service that can be used with any Visual FoxPro based Web backend and any Visual FoxPro client to provide remote data access to Visual FoxPro and ODBC datasources.
Using the Shell API and Internet Explorer Components with VFP
August 8th, 2003Want to integrate external content into your Visual FoxPro desktop applications? Then look into the Shell APIs that allow using Windows components easily in your own applications. This article digs into using the ShellExecute API, the InternetExplorer.Application COM object and the Microsoft Web Browser ActiveX control for displaying Web and Windows content dynamically in your own applications. Article includes lots of short immediately useful samples and a detailed reference of how to use the HTML DOM object model from VFP.
Web Farming with Network Load Balancing in Windows Server 2003
June 4th, 2003Hit the limits of your hardware for a Web application? Find out how to scale out your application to run on multiple machines using the Windows Server Network Load Balancing Service. Windows Server 2003 brings a new front end to the Network Load Balancing Service that makes it easier and cheaper to implement a Web Farm of multiple redundant servers that can work in tandem to handle the meanest traffic you can throw at it.
Using the ASP.Net Runtime for Scripting in Desktop Applications
June 4th, 2003Want to embed the power of ASP.Net into your application to provide rich and dynamic HTML displays in your applications? Add the ability to dynamically execute script code that is changeable after compilation? Don't want to give up debugging and the rich VS environment even in script code? Then take a look at hooking the ASP.Net runtime into your own applications. This article describes what it takes to integreate the ASP.Net runtime in desktop apps and provides an easy to use class that makes integration a matter of a few lines of code.
Creating a custom Statusbar Control in Visual FoxPro
April 20th, 2003Irritated by the lack of Theme support and inconsistent behavior of the Statusbar control in MSCOMCTL.OCX? This article describes how to take advantage of a number of Visual FoxPro 8's new features to build a useful replacement to the MSCOMTL statusbar control. Besides showing off some new VFP features like collections, BINDEVENTS, the new Empty object and ADDPROPERTY, it provides a ready to use class that provides the most common functionality of the StatusBar with VFP code.
Using .NET Components via COM from Visual FoxPro
January 2nd, 2003This article describes how to use .Net components from unmanaged applications such as Visual FoxPro or Visual Basic. The topics describe the basic process of creating .Net components and exporting them to COM and then delves into additional topics of how to pass and access various special types passed over the COM boundaries. In addition, the article also points out a number of things to watch out for such as debugging, installation, dealing with type issues and more.
Calling VFP COM components from ASP.NET
January 1st, 2003Find out how to call VFP COM components from .Net and specifically ASP.Net. The article introduces the basics of importing COM components into .Net and then referencing the component. It also touches on how to pass various types of data between VFP and .Net when import types don't work. You'll also learn how to debug COM components from ASP/ASP.Net as well as the performance implications of using VFP components in ASP.Net.
.NET Interop for Visual FoxPro
Sept. 23, 2002Find out how you can use VFP code in .NET and how to use .NET code in Visual FoxPro, in this comprehensive article that covers a number of different ways that you can integrate Visual FoxPro and .NET. The main three areas that are discussed are using the VFP OleDb provider, COM Interop both calling VFP components from .NET (and ASP.NET specifically) and calling .NET components from VFP and finally using Web Services for interop. The document points out some pitfalls and workarounds and tricks for working with data retrieved from .NET. This article is very detailed and hence fairly long at 45 printed pages.
Dynamically executing code in .NET
Sept. 8th, 2002This article discusses in detail how to execute code dynamically by creating code and compiling it at runtime. This is a useful feature for extending applications with user extensions or for adding support for advanced templating. The article discusses the process of compiling code and utilizing the new assembly. Also provided are classes that simplify the process and an ASP like script parser that can be plugged into any application with a few lines of code.
Automatic Code Updates over the Web with Visual FoxPro
Retrieve HTTP content with .NET
Visual Foxpro Reports on the Web with Adobe Acrobat
Passing data over .NET Web Services
Using the Office Web Components to create dynamic graphs
Web Services with .NET and Visual Studio.NET
long Web Requests with Asynchronous Request Processing
IIS via code with the IISAdmin Objects
SOAP Web Service with West Wind Web Connection
Services in distributed applications
Building distributed applications with XML messaging
Balancing Web Application with Windows 2000 Advanced Server
Using SOAP to call Remote Objects
VFP COM components with Active Server Pages
Stress Testing Web
Applications with Microsoft's Web Application Stress Tool
Using Microsoft Transaction
Server with VFP11/12/99
Distributed Applications over HTTP11/12/99
Internet Enabling Visual FoxPro Applications4/22/99
Scale Web Applications with Visual FoxPro6/3/98
Visual FoxPro COM objects from Visual C++10/18/98
Microsoft's FoxISAPI 6/3/98
FoxPro COM components with IIS 4.0 12/27/97
Active Directory and the IIS Admin Objects with VFP 12/27/97
Things have changed for using COM/Automation servers with IIS in the latest version. This document
Connectivity on the Internet with Visual FoxPro
Visual FoxPro COM objects from Visual C++08/18/98
Rick Strahl's Web Log
Web Connection Web Log
Popular Web Log Entries:
POSTing data to AJAX Services from jQuery Calling AJAX WCF Web Services from jQuery Client Templating with jQuery Implementing a jQuery Statusbar Levels of Developer Enthusiasm Implementing jQuery-Calendar in ASP.NET Hosting the .NET Runtime in Visual FoxPro Expanding Urls with RegEx in .NET Common Bitmap rendering issues in ASP.NET Capturing Output from ASP.NET Pages Making sense of ASP.NET Paths Creating high quality Thumbnails in ASP.NET Understanding ASP.NET Impersonation
|Html Help Builder Home | White Papers | Message Board | Search | Products | Purchase | News ||