using System;
using System.Collections;
using System.Collections.Specialized;  
using Meta.Web.Controls;  

namespace MetaSite.Components.Controls.Views
{
	/// <summary>
	/// ListContainer¡£
	/// </summary>
	public class List : TemplateContainer
	{
		protected override void OnInit(EventArgs e)
		{			
			foreach(DataList l in ListItems)
			{
				if (l.TableName != null && l.TableName != string.Empty)
				{
					NameValueCollection nc = this.Page.Request.QueryString ;
					string[] pval = new string[nc.Count];
					for(int i = 0;i<pval.Length;i++)
					{
						pval[i] = nc[i];
					}

					l.DataSource = (IList)new Data.DataListSrc(l.TableName,pval).DataSrc;
				}
			}

			base.OnInit (e);
		}
	}
}
