Gaia and Ajax on Mobile Devices

by Jan Blomquist 25. February 2009 10:28

More and more Ajax Web applications are targeting the mobile browser. The age of dull and slow web experiences are long gone and the demand for high response and high interactivity on the mobile phone is here. At the end we present the 10 key tenets for building these next generation mobile web applications. 

Gaia Ajax on Mobile Devices in the Real World

Recently we delivered an Ajax Web Application with a Dual UI using templating techniques spiced with inspiration from Model View Presenter. The result was a single codebase with simple multi-device targeting. All built with open source technologies like Gaia Ajax, Castle ActiveRecord, Nhibernate, ZedGraph, NUnit and MySQL. And of course the solution worked nicely on Mono too :-)

We've tested Gaia Ajax on the following devices

All of them worked nicely with Gaia Ajax, except a few customizations for Opera Mobile. Let's have a look at how you can enable Gaia Ajax for this wonderful browser too, which by coincidence happens to be developed here in Norway too.

Fix for Opera Mobile

We use Prototype.js under the hood on the client side and unfortunately there's a small bug in Prototype that makes the Ajax engine break down on Opera Mobile. There are two ways to work around this problem.

  1. Embed the code snippet below somewhere on your ASP.NET page to override the Ajax.Request prototype implementation.
  2. Overwrite prototype.js in the Gaia.WebWidgets project and rebuild.


   1:  <script type="text/javascript">
   2:      Element.observe(window, 'load', function() {
   3:          Ajax.Request.prototype.initialize = function(url, options) {
   4:              this.options = {
   5:                  method:       'post',
   6:                  asynchronous: true,
   7:                  contentType:  'application/x-www-form-urlencoded',
   8:                  encoding:     'UTF-8',
   9:                  parameters:   '',
  10:                  evalJSON:     true,
  11:                  evalJS:       true
  12:              };
  13:              Object.extend(this.options, options || { });
  15:              this.options.method = this.options.method.toLowerCase();
  16:              if (Object.isString(this.options.parameters))
  17:                  this.options.parameters = this.options.parameters.toQueryParams();
  18:              else if (Object.isHash(this.options.parameters))
  19:                  this.options.parameters = this.options.parameters.toObject();
  21:              this.transport = Ajax.getTransport();
  22:              this.request(url);
  23:          }
  24:      });
  25:  </script>

It's worth mentioning that this patch is only valid for Gaia Ajax since we know what we use.

Note! This is not a patch that should be applied to Prototype.js overall.  

Another 10 Key Reasons to use Gaia Ajax for Mobile Web Development

  1. Unified codebase
  2. Multi device targeting for broad reach
  3. No need to expose biz logic to client
  4. Single point of deployment
  5. Based on open standards
  6. Write applications in managed code (C#, VB.NET, Ruby.NET, IronPython, etc)
  7. No sync issues
  8. Minimal maintenance costs
  9. Rich user experience without the need for javascript
  10. No security hazards/breaches
Don't surrender to binary code distributions, but embrace open standards.

Ajax Control Extensions for ASP.NET with Gaia Ajax 3.5

by Jan Blomquist 21. February 2009 20:05
Retro Tv

To lessen the learning curve of creating custom control extensions for Gaia Ajax, we've added some ItemTemplates to Visual Studio both for VB.NET and C#.

Some people have commented that Gaia Ajax doesn't offer a good client side story; This is simply not true. Gaia Ajax offers a plethora of ways for you to write both the client and server layer. Connecting the parts together through our Ajax machinery is an option, not a core requrement. 

Instead of writing a long blog about this, we've published a video tutorial instead (approx. 28 minutes) that you can find in our Gaiaware TV center. The video is available for download or online viewing (Flash)

In this video we're covering how to create a simple control extension with a thin javascript file available. It's the purpose of this tutorial to mostly be concerned about connecting the client and server parts together with the Gaia Ajax machinery.

Quick Agenda overview

  1. Creating the Project and adding the control
  2. Discussing the anatomy of a Gaia Control
  3. Serializing Property changes to the client
  4. Sending method calls to the client
  5. Calling the server from the client and dispatching an event

Overview of the code written in this video

C# Code

   1:  /* Gaia Ajax HelloGaia Template for Simple Extensions */
   3:  using System.Web.UI;
   4:  using Gaia.WebWidgets;
   6:  [assembly: WebResource("Gaiaware.CustomExtensionControls.HelloGaia.js", "text/javascript")]
   8:  namespace Gaiaware.CustomExtensionControls
   9:  {
  10:      using System;
  11:      using Gaia.WebWidgets.HtmlFormatting;
  13:      /// <summary>
  14:      /// Gaia Ajax HelloGaia 
  15:      /// </summary>
  16:      public class HelloGaia : GaiaControl, IAjaxControl
  17:      {
  18:          public event EventHandler Clicked;
  20:          [Method]
  21:          internal string ClickedMethod()
  22:          {
  23:              if (Clicked != null)
  24:                  Clicked(this, new EventArgs());
  26:              return string.Empty;
  27:          }
  29:          protected override void IncludeScriptFiles()
  30:          {
  31:              base.IncludeScriptFiles();
  33:              // Include Attached Javascript file
  34:              Manager.Instance.AddInclusionOfFileFromResource("Gaiaware.CustomExtensionControls.HelloGaia.js", 
  35:                  typeof(HelloGaia), "Gaiaware.HelloGaia.browserFinishedLoading", false);
  37:          }
  39:          public void SayHello()
  40:          {
  41:              _sayHello = true;
  42:          }
  44:          private bool _sayHello;
  46:          [AjaxSerializable("sayHello")]
  47:          private bool SayHelloMethod
  48:          {
  49:              get { return _sayHello; }
  50:          }
  53:          [AjaxSerializable("setCssClass")]
  54:          public string CssClass
  55:          {
  56:              get { return ViewState["CssClass"] == null ? "" : ViewState["CssClass"] + ""; }
  57:              set { ViewState["CssClass"] = value; }
  58:          }
  60:          protected override void RenderControlHtml(XhtmlTagFactory create)
  61:          {
  62:              using (Tag root = create.Div(ClientID))
  63:              {
  64:                  root.WriteContent("Hello Gaia");
  65:              }
  66:          }
  68:          #region IAjaxControl Members
  70:          string IAjaxControl.GetScript()
  71:          {
  72:              // Register the Control ClientSide
  73:              return new RegisterControl("Gaiaware.HelloGaia", ClientID).ToString();
  74:          }
  76:          #endregion
  77:      }
  78:  }


   1:  /* Gaia Ajax Extension */
   3:  // Create root namespace
   4:  if( !window.Gaiaware )
   5:    Gaiaware = Class.create();
   7:  // Create the Extension Control
   8:  Gaiaware.HelloGaia = Class.create(Gaia.Control, {
  10:      // Constructor
  11:      initialize: function(element, options) {
  12:          this.initializeHelloGaia(element, options);
  13:      },
  15:      initializeHelloGaia: function(element, options) {
  16:          // Calling base class constructor
  17:          this.initializeControl(element, options);
  19:          Element.observe($(element), 'click', this._onClick.bind(this));
  20:      },
  22:      _onClick: function(evt) {
  23:          Gaia.Control.callControlMethod.bind(this)('ClickedMethod', null, null,;
  24:      },
  26:      setCssClass: function(value) {
  27:          $(this.element).className = value;
  28:          return this;
  29:      },
  31:      sayHello: function(value) {
  32:          alert('Hello');
  33:          return this;
  34:      },
  36:      // Destructor
  37:      destroy: function() {
  38:          // TODO: Put destruction code here
  39:      }
  41:  });
  43:  Gaiaware.HelloGaia.browserFinishedLoading = true;

If you like the video tutorials we're creating and find them useful, please give us some feedback on it. Are we touching base?

Until next time Smile 



Gaia Ajax 3.5 Release Candidate 2

by Jan Blomquist 20. February 2009 19:37

Gaia Ajax 3.5 has been cooking for some time now and final release is just around the corner. We want to receive more feedback on the bits before we mark it as the final product so we're giving you another RC instead of regrets. Smile

We want to thank all who has committed feedback on the bits and helped us increase product quality along the way. More and more people are discovering the Gaia Ajax way of building ASP.NET Applications every day.

If you want to help us shorten the time it takes for the final release, we suggest you download the RC and upgrade your applications using the bits and give us feedback on what you think. We want to hear both good/bad.

Links and Downloads

What's up since the last release candidate

  • Installer and Visual Studio.NET designers are implemented and tested.
  • Tested and corrected minor issues in some of the A grade browsers.
  • Added Documentation and ItemTemplates to Visual Studio
  • Fixed severe issue related to dynamic controls
  • Latest release was built using the custom in-house build system.
  • For a full list of issues fixed look at the bottom of this post

New! Visual Studio Templates

If you want to get up to speed about new stuff available in Gaia Ajax 3.5 you've probably noticed that we've published a lot of content and tutorials related to the release. In the latest installer we've also added some ItemTemplates to Visual Studio that will aid you in creating extensions more easily.

We've created the following templates for you 
  • Gaia Aspect Extension
  • Gaia Control Extension
  • Gaia Container Control Extension
We've published a 30 minute video showing you how to leverage these templates to build custom control extensions for Gaia Ajax here

Or revist recent blogs that highlight new features/enhancements in the Gaia Ajax 3.5 product. 


Also in the latest bits you will see that we've embedded the documentation API reference in .chm file format. Hopefully this will also simplify your development.

Click here to view the API documentation online (Available as .chm in the downloadable package)

Instead of repeating ourselves over and over you can read about new features/highlights in the Gaia Ajax 3.5 release  just by looking at previous release blogs regarding the product.

Related Blog posts

List of issues fixed since the last release candidate

Issue Type Priority Severity Component Summary
SETUP-219 Bug Medium Trivial Setup

Start menu shortcuts issue 

WEB-231 Enhancement Low Trivial Samples

RSS Reader sample enhancement 

VSNET-248 Bug High Trivial Visual Studio Integration

Trial.License file empty in trial installation 

WEB-232 Bug Medium Major Samples

IGoogle sample does not work 

WEB-252 Bug Medium Trivial Samples

Drag and Drop in RSS Reader 

GAIA-254 Bug High Major Gaia.Ajax.Core

Gaia control in Usercontrol updated from parent page has type error 

GAIA-241 Bug Low Trivial Window

When Window is Maximized after Resizing, the ContentArea remains fixed 

GAIA-245 Enhancement Low Trivial Calendar

Simplify subclassing of the Calendar by exposing rendering steps 

GAIA-243 Bug Low Trivial Window

Window CenterInForm issue 

GAIA-224 Bug Low Trivial Window

Window default skin maximization 

GAIA-223 Bug Low Trivial Window

Window default skin 

GAIA-238 Bug Low Trivial ExtendedPanel

Text is not indented properly when applying IconCssClass to ExtendedPanel 

GAIA-235 Bug Low Trivial ExtendedButton

OnClientClick property for ExtendedButton is not supported 

GAIA-203 Bug High Major DateTimePicker

DateTimePicker fails after re-selecting a date 

WEB-172 Bug Low Minor Samples


VSNET-5 Bug Medium Minor Visual Studio Designers

ExtendedPanel Designer Collapse 

VSNET-37 Bug Low Major Visual Studio Integration

Visual Studio 2008 Pro Integration fails languages other that EN 

VSNET-183 Bug Low Trivial Visual Studio Designers

When dragging TextBox into ExtendedPanel it adds KeyChangeEventsInterval="500" 

VSNET-236 Enhancement Low Trivial Visual Studio Designers

Make Timer more visible on design page 

VSNET-216 Bug High Major Visual Studio Integration

Visual Studio 2008 SP1 doesn't fill toolbox during installation 

VSNET-207 Bug Medium Major Visual Studio Designers

Issues with designers in Visual Studio 2008 SP1 

SETUP-99 Bug Low Minor Setup

License Activator is not stable 

SETUP-165 Bug Low Trivial Setup

Detect VS.NET localization 

SETUP-212 Bug Low Trivial Setup

Statement in full setup is wrong 

GAIA-237 Bug Low Trivial DateTimePicker

DateTimePicker Close button related style issue 

WEB-98 Enhancement Medium Trivial Samples

Remove or change the large pictures used in DynamicImage 

GAIA-211 Bug High Show Stopper Panel, Window

Close window and visible=false on e.g Panel makes error in IE8 BETA 

GAIA-229 Bug Medium Minor ImageButton

ImageButton postback issue in Mono 

SETUP-196 Bug Low Trivial Setup

Browse on setup only gives you Program files and children as options 

GAIA-209 Bug Low Trivial Calendar

Close button on Calendar must be visble false initially 

GAIA-213 Bug High Show Stopper RadioButtonList

Bug in RadioButtonList when changing in Page_Load 

GAIA-215 Bug High Show Stopper Gaia.Ajax.Core

Dynamic Controls State Management 


Gaia | Release

Adding a ConfigurationSection to your Gaia WebSite

by Jan Blomquist 17. February 2009 14:04

Now you can configure Gaia Ajax both programmatically in C# and through Web.Config. We've introduced our custom ConfigurationSection so that you can modify the behaviour of Gaia more easily.

 The first thing you need to do is define the custom ConfigurationSection in web.config. If you want to read more about .NET ConfigurationSections click here for the MSDN documentation on the subject.

   1:  <configSections>
   2:      <section 
   3:      name="GaiaAjaxSection"
   4:      type="Gaia.WebWidgets.GaiaAjaxConfigurationSection"
   5:      restartOnExternalChanges="true">
   6:      </section>
   7:  </configSections>
The next thing you can do is go ahead and implement the configuration section and set the properties you want.
   1:  <GaiaAjaxSection
   2:      EnableDefaultTheme="false"
   3:      EnableJavaScriptInclusion="true"
   4:      EnableDynamicScriptLoading="false"
   5:      EnableNestedCssClasses="true">
   6:  </GaiaAjaxSection>

So what exactly does these options do? Let's have a look at the different property settings and the consequences of implementing them.

1. EnableDefaultTheme

Gaia Ajax offers default theme capabilities so that if you haven't defined a CssClass and imported a style sheet, you will get some basic UI for your controls. Here's an example of Window, Button and Calendar with default themes. If you explicitly set the CssClass either directly or by using Themes or StyleSheetTheme, then the default theme will not be applied.

2. EnableJavaScriptInclusion

Gaia Ajax automatically embeds all required javascript, but if you prefer to manually include the javascript files you can turn off this setting. Reasons for turning it off could be

  • You have done custom concatentation/changes of the javascript files
  • You are hosting the javascript files on a remote / cache server
  • You want to have direct references instead of the cryptic references

3. EnableNestedCssClasses

All Advanced Gaia Ajax controls are rendered with a set of nested html elements that have defined unique css classes. This greatly simplifies skinning and we've tried to base the document layout according to best practices. If you don't like our suggested cssclass definitions and would like to override it with your own behaviour you can set this property to false. Output with nested css classes looks like this ...
   1:  <div class="default-window" id="Div1">
   2:      <div class="default-window-tl" id="Window1_header">
   3:          <div class="default-window-tr">
   4:              <div class="default-window-tc">
   5:              </div>
   6:          </div>
   7:      </div>
   8:      <div style="overflow: hidden;" class="default-window-contentwrapper">
   9:          <div class="default-window-ml" id="Window1_middle">
  10:              <div class="default-window-mr">
  11:                  <div class="default-window-mc">
Output without nested css classes looks like this ...
   1:   <div class="default" id="Div1">
   2:              <div id="Window1_header">
   3:                  <div>
   4:                      <div>
   5:                      </div>
   6:                  </div>
   7:              </div>
   8:              <div style="overflow: hidden;">
   9:                  <div id="Window1_middle">
  10:                      <div>
  11:                          <div>

4. EnableDynamicScriptLoading

Gaia Ajax has the option of automatically loading required javascript files on-demand in ajax callbacks. This feature is now turned off by default. Gaia Ajax 3.5 will automatically embed all javascript in one single file and include that file. If you still want to enable the dynamic script loading capabilities you can turn this feature on. Great, hopefully you see that custom configuration sections simplify configuration of your ASP.NET / Gaia Ajax application. 

Here's an example of how dynamic script inclusion looks like in FireBug

If you want to programmatically changes these values you can access them through code. Just access the singleton instance on GaiaAjaxConfiguration and set the properties yourself. These features are just some of the goodies coming up in Gaia Ajax 3.5.

Smarter HybridControl Collections in Gaia Ajax 3.5

by Jan Blomquist 15. February 2009 21:30


When building reusable server controls we have a plethora of different ways to build them. There are pros and cons to every solution and finding the best approach is not always easy. In Gaia Ajax 3.0 we introduced the HybridControl which is a combination of a composite control and a container control. That means we add some of our own controls and aspects to the control in addition to the controls the developer adds. Since we haven't seen this pattern (please correct us if we are wrong) we named the pattern HybridComposition.

Some examples of HybridControls include

  • Window
  • ExtendedPanel
  • TreeView
  • Toolbar 

The immediate benefit of the HybridControl is that you can directly add child controls in design time, markup and runtime. In runtime you get simple access to the controls just by typing in their name or accessing them through the controls collection.

   1:  Window1.Controls.Add(new LiteralControl("Hello Gaia Developers")); 


There were however some issues we encountered with this approach. Here are just some of the problems and you probably encountered one or more of them.

  1. The Controls collection wasn't fully yours anymore. It was mixed, partially ours, partially yours. That means a Controls.Clear() would destroy the HybridControl because the composite controls would be removed aswell.
  2. ForceAnUpdate implementation would get in the way of property serialization. That means when you tried to re-render for example the Window, the Caption would be left untouched even if you changed it, because partial rendering would overrule serialization.
  3. In some controls like the TreeView where you want to access both TreeViewItems and your custom controls, there were no clear separation of what belonged where. Effectively you ended up searching the Controls collection and filtering out stuff manually.


We've created specialized Control Collections and Collection wrappers in Gaia Ajax 3.5 to offer a clean and intuitive solution to the above problems. Since we cannot touch the Controls collection itself because ASP.NET heavily relies on it, we have chosen an approach were we sit on top of the existing collection and offer specalized behaviour on a pr/hybridcontrol basis. This generic wrapper is the foundation for all the other collections.

   1:  public abstract class ControlCollectionWrapper<T> : ICollection<T> where T : Control {}
The most important function that sits here is the IsValidControl(). For each control in the collection, derived collections can implemented this function to verify if the current control is valid in the collectionwrapper or not.
   1:  protected abstract bool IsValidControl(Control control);
For example in HybridPanelBase, the ancestor of Window we use the HybridControlCollection which is implemented like this
   1:  public class HybridControlCollection<T> : ControlCollectionWrapper<T> where T : Control
   2:  {
   3:      private readonly ICollection<Control> _skipTheseControls;
   5:      public HybridControlCollection(T ownerControl, ICollection<Control> skipTheseControls) 
   6:      : base(ownerControl)
   7:      {
   8:          _skipTheseControls = skipTheseControls;
   9:      }
  11:      protected override bool IsValidControl(Control control)
  12:      {
  13:          return !_skipTheseControls.Contains(control);
  14:      }
  15:  }

Based on the ControlCollectionWrapper we've currently created the following derived collections.

  • ControlCollectionExcept
  • ControlCollectionOf
  • HybridControlCollection

On the Window we define two collections, one is for the composition controls and the other is for the normal childcontrols. The signatures are as follows

   1:  protected internal ICollection<Control> CompositionControls {get;}
   2:  public virtual HybridControlCollection<Control> ChildControls {get;}


With this approach you will always have access to all your custom childcontrols in the ChildControls collection wrapper. The following operations which was considered hazardious in the 3.0 release is now safe and correct.

   1:  Window.ChildControls.Clear();
   2:  Window.ChildControls.InsertAt(0, new Control()); 
   3:  Window.ChildControls.RemoveAt(0);
Let's move over to the TreeView. The TreeView contains TreeViewItems which can be made up of more TreeViewItems or custom controls. Here we use both the ControlCollectionOf and ControlCollectionExcept to offer ways to manipulate both the Child TreeViewItems and custom ChildControls. The collections are implemented as follows
   1:  public ControlCollectionOf<TreeViewItem> TreeViewItems { get;}
   2:  public ControlCollectionExcept<TreeViewItem> ChildControls { get;}

It basically means the first collection is made of TreeViewItems, whereas the other collection is made up of anything, but TreeViewItems. Because we now have these collections on the TreeView, we suddenly have the same flexibility on the TreeView if we want to

  • Modify the TreeViewItems collection and perform now supported operations like Clear(), InsertAt(), RemoveAt(), etc.
  • Add custom ChildControls without having to deal with the TreeViewItems which are also in the collection.
  • It greatly simplifies ForceUpdate() scenarios since you have greater control over what you want to have re-rendered and not. We also have a few more control collections in Gaia Ajax 3.5, including the GenericControlCollection and AspectCollection.
We really hope you appreciate the research and development we are doing in this HybridControl space and we'd love to have your feedback on it. Dino Esposito reacted by saying "Wow! This is much better". We hope you think the same. 

Tags: , ,

Ajax | Gaia

Ajax Multiple FileUpload for ASP.NET

by Jan Blomquist 13. February 2009 08:52

Every Web 2.0 site deserves a good Ajax FileUpload control. That means something that doesn't post back and leave you thinking if the upload was successful or not. For a fully functional website it's common to upload files for processing or usage. Examples include photos, data, text files, documents, etc. In this post we're going to cover one of the latest contributions to the Gaia Ajax control family. The FileUpload Control :-) 

The control was created by Pavol and resides in the CommunityExtensions project. The original work can be found here. It has now been made available in the library and is to be shipped with Gaia Ajax 3.5 codename "Themis". Let's go ahead and have a look at how you can apply ajaxified FileUpload capabilities to your application. The control allows a user to select multiple files to upload and one file will be uploaded at the time.

Code Usage

You can configure it for a maximum allowed number of files. In ASPX markup the FileUpload control looks like this. Not all properties are set, but you can see the most important ones below. We've set the MaxFiles to 5, meaning no more than 5 files can be uploaded at any given time.

   1:  <gaia:FileUpload
   2:          ID="fileUpload" 
   3:          runat="server"
   4:          TextHeader="Files to Upload. (Max 4MB per file)" 
   5:          MaxFiles="5"
   6:          OnFileUploaded="fileUpload_onFileUploaded"
   7:          UploadOnce="false" 
   8:          ImgLoadingSrc="Media/file-loader.gif" 
   9:          CssClass="fup" >
  10:  </gaia:FileUpload>
The most important thing is the OnFileUploaded event. This is fired on the server for each file that is uploaded. In the EventArgs you can get access to the PostFile and decide what you want to do with it. Here we're just calling SaveAs() to persist the file to disk. If the uploaded was successful you can send a friendly text message back to the client.
   1:  protected void fileUpload_onFileUploaded(object sender, FileUpload.FileUploadEventArgs e)
   2:  {
   3:      string fileName = Server.MapPath("~/Images/") + e.PostedFile.FileName;
   4:      e.PostedFile.SaveAs(fileName);
   5:      e.InfoText = "File was successfully uploaded";
   6:  }

Having a FileUpload citizen in the Control suite is a great addition and we've already gotten extensive feedback on the value-add this provides for the library. In the samples that ships with Gaia we've added a quick demo in the DynamicImage sample to demonstrate further use of the FileUpload control.Here you can upload files that will be made available for use in the DynamicImage sample. Ps! This feature is only enabled when the samples are run from localhost to avoid uploading too many images to our servers.

Control can be added dynamically on the page just like any other control and you can have more than one control on the page if you like.


  • UploadOnce Set to true if you want to upload files only once and then the control becomes disabled
  • MaxFiles - how many files do you want to upload at one moment
  • MakeCallback - Set to true if you wish a callback after all files has been uploaded to the server. 
  • ImgLoadingSrc - if you want to show image while uploading the file. Also you can set all texts through attributes. Just check the code for all of them. They all start with Text. Like TextHeader, TextUploaded etc.


  • FileUploaded - file has been uploaded. If you are uploading three files, then this will event will fire three times.
  • UploadFinished - after all files has been uploaded, you'll get this event. Also if you want to modify any controls in your page. Do it in this event not in FileUploaded

Hopefully this will not be the last contribution to the CommunityExtensions project. All members of the Gaia Community have permissions to upload controls/extensions to the WIKI. A couple of days ago another community member, Nathan posted the InPlaceCollectionEditor.

Gaia Ajax offers an extensible solution for building advanced controls, either in pure C# or with a thin javascript file to embed advanced functionality. This offers you unlimited opportunities when using Gaia Ajax as the main toolkit for building the presentation layer of your web applications. 

Inherit Gaia Ajax Dynamic Image to make it Selectable

by Jan Blomquist 9. February 2009 06:00

Gaia Ajax allows you to create scalable web applications by utilizing the full power of the server and server control framework in ASP.NET. We encourage all our users to utilize the server control pattern when building modular and scalable web applications. You can use many approaches to build such controls. One pattern we visited in the Creating an Ordered ListControl in C# was the encapsulation w/ proxy pattern or composition if you like. In this blog we're going to discuss direct inheritance. This is something you would want to do when you need to extend the behaviour/functionality of your controls.


Easily create Drag & Drop dashboards in ASP.NET

by Jan Blomquist 5. February 2009 10:20

Modal Ajax Messagebox for ASP.NET in Gaia

by Jan Blomquist 5. February 2009 09:15


Most applications today utilizes some kind of messagebox to either give feedback to the user or halt the execution of the application, until the user performs a choice. Typically Ok, Yes, No or Cancel. Creating such a control for the web can be a daunting task, but it doesn't have to be. By using Gaia Ajax we can pop out a fairly feature rich MessageBox in a short amount of time. In this blog I am going to create the MessageBox and use it in a simple sample. The code will be provided for download if you find it useful. 


Traversing the ASP.NET Control Tree with LINQ

by Jan Blomquist 4. February 2009 05:00

Many users of ASP.NET has over the years created various helper classes and utilities to simplify traversing the ASP.NET Control structure. Samples include the Generic FindControl<T> function which I've seen countless implementations of.

Well, we all know that re-inventing the wheel is unwise if you want to leverage high productivity. Fortunately with the arrival of C# 3.0 we've got this little thing called LINQ which is basically just a collection of related inventions like Extension Methods, Lambdas, Anonymous Types, Object Initializers, etc. It turns out that LINQ enables us to apply some powerful querying on top of ASP.NET and in many cases with simple one liners. Using Linq directly makes code alot easier to read. Here's an example of how using Linq to validate if a Question is answered correctly just to show the power of the syntax.