Monday, May 2, 2011

How to choose open source license by diagram

Just made a simple description of popular free software licenses

how to prevent the ASP.NET page being cached

Put following code into Page_Load

How to solve "Failed to load viewstate" occasional problem for dynamically loading usercontrols in ASP.NET WebForms?

Full error message:
Failed to load viewstate.  The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request.  For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.

How to replicate:
-Add a control dynamically to a placeholder and the control viewstate is enabled, and on the postback, add a different control to the placeholder.

Add user control to a Panel, and Add Panel into placeholder
                Panel p = new Panel();
                Control ctl = this.LoadControl(controlPath);
                ctl.ID = "uc" + i.ToString();
                i += 1;


How to understand jQuery source code
By John Resig from jQuery
You can read and run source code, very same style javascript code like jQuery in this web site

Learning Advanced JavaScript

1) Our Goal
2) Defining Functions
3) Named Functions
4) Functions as Objects
5) Context
6) Instantiation
7) Flexible Arguments
8) Closures
9) Temporary Scope
10) Function Prototypes
11) Instance Type
12) Inheritance
13) Built-in Prototypes
14) Enforcing Function Context
15) Bonus: Function Length