How to compress webpages with gzip using global.asax

June 7, 2011 - 12:46

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

June 6, 2011 - 09:02

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

June 5, 2011 - 06:42

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

June 5, 2011 - 05:27

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+

June 4, 2011 - 13:11

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+

June 4, 2011 - 13:06

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

June 4, 2011 - 12:50

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

June 4, 2011 - 11:50

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.

September 2, 2010 - 07:20

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

July 31, 2010 - 05:30

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.


© 2011 simplevb.net