Blog posts about codeproject
The project have been constructed to be:
- Powerful - use well proven compressors from YUI together with automatic GZip to further decrease the file transfer.
- Easy to use - just replace your script-tags with a custom webcontrol to implement in your project.
- Easy to develop with - set a single property in your web.config to disable the compression to help debugging scripts.
The main idea is to have all scripts and css-files in a readible form on the server and compile them to one compressed and minified file when transfered to the visitor in order to decrease bandwidth and most important of all: load time of the page.
The compressed file is cached client side with a hash stamp that makes the web browser request a new file if it has changed since last request from the server.
Take a look at the article describing the project:
SmartInclude article and code at CodeProject
You can always find the latest code over at smartinclude.codeplex.com.
TextBlock t = new TextBlock();
int columnWidth = 310;
t.FontFamily = new FontFamily("Arial");
t.FontSize = 20;
t.Text = "Here goes the text..";
t.Width = columnWidth;
t.TextWrapping = TextWrapping.Wrap;
int textHeight = (int)t.DesiredSize.Height;