ASP.NET Sample Code
-
Sending email from ASP.NET
by Orcs Web
One of the most commonly performed operations that I see in web applications - aside from database actions - is sending email from code. This demonstrates how in ASP.NET.
-
Spoofing the Referrer using HttpWebRequest
by Dave Wanta
Here's a simple way to spoof the referrer to a web page during a web request.
-
Resizing images retrieved from SQL server
by Simon Soanes
A neat way of fetching an image stored in SQL Server and resizing it before save/sending it anywhere.
-
How to get information about the current browser
by Edward Tanguay
This code shows you how ASP.NET simplifies information about the current browser into class properites. There are others but these are the most useful.
-
Sending Authenticated Emails in .NET 2.0
by Xavier Larrea
Learn what's changed with .NET 2.0 and how to send out emails using an SMTP server that requires authentication.
-
Applying XSL transformations to XML in .NET
by Krishnan
A simple demonstration of how to apply an XSL transformation to an XML file and save the output using .NET
-
Dynamically loading an IBindableTemplate
by James Crowley
Demonstrates how to dynamically load an IBindableTemplate from a file for use with new ASP.NET 2.0 controls such as the FormView, to workaround the lack of a LoadBindableTemplate method in the new version of the framework.
-
Transactions made easy with .NET 2.0
by Xavier Larrea
One of the more significant improvement in .NET 2.0 is the transactions area. Now with a single line it becomes extremely easy to support transactional code blocks using the concept of “ambient” transaction thanks to TransactionScope in the System.Transactions namespace.
-
Developing your first Visual WebGui application
by Guy Peled
An introduction to Visual WebGui through a sample application.
-
Precise .NET Server Content Caching
by Dimitrios Markatos
A simple demonstration of how to programatically use the caching facilities that ASP.NET offers.
-
Visual WebGui a unique approach to AJAX development
by Guy Peled
Visual WebGui is not just another AJAX framework but rather a different approach to web application development, specially designed to simplify building highly complex applications like Outlook Web Access (OWA). Visual WebGui makes it possible for developers to create applications that were previously developed only by the "big guys".
-
RSS Feed Helper Class
by James Crowley
A simple helper class to make generating an RSS feed a piece of cake - its the one we use on Developer Fusion too!
-
Forms Authentication Against An XML File
by Orcs Web
The code demonstrates how to validate a username and password against an XML file.
-
Creating a dynamic graphic which returns a .jpg
by Edward Tanguay
This code allows an .aspx file to receive parameters (file name and width of picture) and return a JPEG resized to the requested width.
-
A PagingRepeater control
by Dan Glass
A PagingRepeater control extending Repeater with page navigation
-
Databinding SqlTypes
by Dan Glass
Demonstrates how Databind the SqlTypes using the PropertyDescriptor class and the ITypedList Interface.
-
How to validate an XML file with an XSD file
by Edward Tanguay
Demonstrates an ASP.NET Web Form which tells you if your file is not well-formed and then if it is not valid it lists out the specific reason (like in XMLSpy), quite helpful to find an error in a large XML file as it returns the line number on which the error occurred as well as the tag name.
-
A Simple ASP.NET MessageBox Class
by Lee Gunn - .NET C# Scotland
When moving from Windows Forms to ASP.NET Web Forms, an API that may be missed is that offered by the System.Windows.Forms.MessageBox Class. Here we implement it for ASP.NET!
-
Custom Word Wrapper
by David Cumps
A nice little class that takes some text, and will automatically wrap it according to a specified width.
-
Add a JavaScript popup to an ASP.NET button
by Edward Tanguay
How to add a javascript popup (alert) question to an ASP.NET button control.