ASP.NET Sample Code
-
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.
-
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.
-
Forms Authentication Against An XML File
by Orcs Web
The code demonstrates how to validate a username and password against an XML file.
-
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.
-
Debug ASP.NET pages using Tracing
by Julian Roberts
Demonstrates a useful debugging technique taking advantage of traces in ASP.NET.
-
Embed text in Image using ASP.NET
by Julian Roberts
Demonstrates how to dynamically embed a text caption embedded into an image.
-
Custom Word Wrapper
by David Cumps
A nice little class that takes some text, and will automatically wrap it according to a specified width.
-
A PagingRepeater control
by Dan Glass
A PagingRepeater control extending Repeater with page navigation
-
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!
-
How to access a MySQL database with .NET
by Edward Tanguay
Demonstrates how to connect to a MySQL database with C#.
-
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.
-
Databinding SqlTypes
by Dan Glass
Demonstrates how Databind the SqlTypes using the PropertyDescriptor class and the ITypedList Interface.
-
How to delete records with SqlCommand
by Edward Tanguay
This code shows you how to delete records with an SQL statement and get the number of records deleted returned back as an integer.
-
How to simulate a status bar in a Web application
by Edward Tanguay
If you have a process that takes over 20 seconds or so on a Web application, you may want to let the user know the status of the process. Edward shows you how.
-
How to create PDF files from ASP.NET pages
by Edward Tanguay
How to create PDF files from ASP.NET pages with Crystal Reports without using Visual Studio.NET
-
ASP.NET Graphical Page Hit Counter
by Raam Kumar
Generate graphics on the fly to provide a graphical page hit counter, storing the counter in a text file or SQL database.
-
Adding controls to PlaceHolders dynamically
by Edward Tanguay
A simple example demonstrating how to dynamically add controls to a PlaceHolder control.
-
How to get an array of all files in a directory
by Edward Tanguay
This simple code will give you an array containing all files in a directory.
-
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.
-
Display SQL Server table data in a browser
by Edward Tanguay
Just supply your database connection string and this code will give you a radio button list of all your SQL Server tables and will show their fields.