Click here to Skip to main content
15,886,724 members
Articles / Web Development / HTML

Runtime Dependent ListBox

Rate me:
Please Sign up or sign in to vote.
3.00/5 (3 votes)
29 May 20071 min read 39.9K   743   18  
This articles describles how to add a Dependent ListBox in Runtime using Ajax (MagicAjax)
using System;
using System.Web.UI;
using System.ComponentModel;

namespace MagicAjax.UI.Controls
{
	/// <summary>
	/// An AjaxPanel that is isolated from the rest AjaxPanels of the page.
	/// </summary>
	/// <remarks>
	/// It's an AjaxPanel that has the MagicAjax attribute "AjaxLocalScope" set to true.
	/// It is provided for convenience and readability.
    /// 
    /// When an AjaxCall is invoked from a control inside an AjaxZone, only the values of the
    /// form elements that are contained inside this AjaxZone will be sent to the server
    /// and the server will check for changes and "reflect" only the AjaxPanels that are
    /// inside the AjaxZone. This helps reduce the Ajax traffic and speed up a bit the
    /// server response. It's intented for isolated and independent portions of a page
    /// like UserControls.
    /// 
    /// An AjaxZone can contain other AjaxZones. A control belongs to the AjaxZone that is
    /// its immediate parent.
	/// </remarks>
	[Designer("MagicAjax.UI.Design.AjaxPanelDesigner, MagicAjax"),
		ParseChildrenAttribute(false),
		PersistChildren(true),
		ToolboxData("<{0}:AjaxZone runat=server>AjaxZone</{0}:AjaxZone>")]
	public class AjaxZone : AjaxPanel
	{
		protected override void AddAjaxAttributesToRender(HtmlTextWriter writer)
		{
			base.AddAjaxAttributesToRender (writer);
			writer.AddAttribute ("AjaxLocalScope", "true");
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer I.ndigo - www.i.ndigo.com.br
Brazil Brazil
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions