Monthly Archives

13 Articles

Posted by .Ronald on

Dust-Me Selectors Version 2.0

After many months of toiling in our secret underground laboratories, Dust-Me Selectors Version 2.0 is finally here!
If you’re one of the many people who made suggestions or commented on the original version, you’ll be pleased to know that the new version incorporates everything you asked for and more.
It was quite a challenge to bring all this together, particularly since Mozilla’s documentation is so … er … erratic (in fact for some functionality I had to look in Firefox’s source code just to figure out how it’s done!) But there’s nothing like a challenge to exercise the mind, and I think you’ll agree that the final result is well worth the gritty struggle.

SitePoint Blogs Dust-Me Selectors Version 2.0

Posted by .Ronald on

How To Create A Custom Control

  1. Create a new ASP.NET Web Application, Windows Forms Control Library or Class Library project
  2. Create a new class and inherit from System.Web.UI.WebControls.WebControl or from a specific control (like TextBox)
  3. Override the Render method and call writer.write() to write raw HTML to the page. ASP.Net server tags won’t work
  4. Use WriteBeginTag(), WriteEndTag(), RenderBeginTag(), RenderEndTag(), AddAttribute(), AddStyleAttribute() and WriteAttribute() to create HTML tags and attributes
  5. Add design-time attributes to properties, like:
    [Description(“The text to be shown in the control”)]
  6. Define a tagprefix attribute:
    [assembly: System.Web.UI.TagPrefix(“Anthoro.WebControls”, “awc”)]
    namespace Anthoro.WebControls
    { …
  7. Add a toolbox icon:
    1. Create a 16×16 pixel bitmap (BMP 16 colors) with the same name as the control.
    2. Add it to the root of your project
    3. Set its Build Action to “Embedded Resource”
  8. Add additional resources (stylesheet, images, text files, …) and mark them as “Embedded Resource” also
  9. Add an Assembly attribute for each resource to your AssemblyInfo.cs:
    [assembly: WebResource(“”, “text/css”, PerformSubstitution = true)]
    When the PerformSubstitution parameter is set to true, the resource will be processed and other webresource URL’s inside it will be parsed and replaced (works only for text-based resources:
    background-image: url(‘<%= WebResource("Anthoro.Controls.back.png")%>‘);
  10. Pay attention to the full namespace and folder structure where your resources are stored. The resource name is build as: Namespace + Subfolders + filename
  11. At design-time, the control is displayed by running the rendering logic. To override this, use the GetDesignTimeHtml(), GetEmptyDesignTimeHtml() and GetErrorDesignTimeHtml() methods

Update: Unlike in C#, in VB.Net the subfolders are not taken into account with the namespace. So the example above in point 10 will be: Namespace + filename

Posted by .Ronald on

CSS: The Great Spicificity Swindle

Great understandable article about the 3 most important subjects in CSS: the cascade, inheritance and specificity!I recently held a workshop for my colleagues covering these as the primary subjects and more advanced CSS techniques. This article explains them in an understandable non-technical language.

read more | digg story

Posted by .Ronald on

How To Minimize Your Javascript and CSS Files for Faster Page Loads

Over the last 11 years I’ve spent a great deal of time trying to improve client websites with an eye for minimalist interface design and code. While the minimalist design esthetic is not the choice for every client the notion of less code and faster load times always goes over well. Today, many of web applications I design and code for have a plethora of Javascript and CSS files. Fortunately, there are many options to solve this rather simple problem. Compression, obfuscation and bundling are all great options.

Below you’ll find a list of the sites I’ve visited to learn more about Javascript and CSS compression. Please let me know through email or a comment if you know of any other great compression resources, and I’ll be glad to post them. Most of the descriptions below are taken from the developers of the example. Thanks, Max.

Max KieslerHow To Minimize Your Javascript and CSS Files for Faster Page Loads

Powered by ScribeFire.