How to compress webpages with gzip using global.asax
Almost all modern webbrowsers support gzip compression, and its recommended to use this to reduce the size of webpages which in turn can dramatically reduce the download time.
Remove HTML tags from string with RegEx
If you have done a scrape of some data from a webpage, then the obtained string could contain lots of HTML tags such as HREF entries or font formatting. This may not be desirable when that information is displayed on your own site.
Dynamically change an image with javascript
Images displayed in an HTML webpage can be changed with javascript. First use the code below to add an image to your webpage and assign it an ID such as "theimage".
Hide and display a div element using javascript
You may wish to hide or display a certain area of your website when the user clicks on a mouse. To do this first you need to create your area which will be hidden to begin with, and then later displayed using the javascript.
Add text to a bitmap image using GDI+
Adding text to a bitmap requires you to first select the font to use and the colour of the brush to use. The example below loads in a .png file and adds the text "SOLD".
Rotate an image using GDI+
Rotating an image can be usefull when dynamically adding items to an existing image, such as adding a "SOLD" stamp across a products image.
Set and retrieve cookies in ASP.NET
You may wish to set cookies on your webpage which are usefull for things like login areas. This can be done with session variables, but i find those to be less reliable and are regularly cleared when new files are uploaded to the server.
Display the contents of a Table from a Dataset
So you have already queried the database and obtained all the needed information which is contained in a database. This example will step through the rows in the table and display the values. I am assuming you already have a datatable in the dataset ds called "Results".
Read in the contents of a webpage to a string.
You may wish to display the contents of a feed from another website or grab data from another website and perform some processing on this information and then redisplay on your own site.
How to dynamically create a word document in ASP.NET
The easiest way i have found to generate a word document from website content is to use the feature of word to read in HTML documents and display as a normal word document.