private string JSResize(string[] args)
{
if (args.Length != 3)
throw new InvalidJSArgumentException ("ResizeControl", -1);
//look up our component
IComponent component = ((DesignContainer) host.Container).GetComponent (args[0]);
System.Web.UI.WebControls.WebControl wc = component as System.Web.UI.WebControls.WebControl;
if (wc == null)
throw new InvalidJSArgumentException ("ResizeControl", 0);
PropertyDescriptorCollection pdc = TypeDescriptor.GetProperties (wc);
PropertyDescriptor pdc_h = pdc.Find("Height", false);
PropertyDescriptor pdc_w = pdc.Find("Width", false);
//set the values
pdc_w.SetValue (wc, pdc_w.Converter.ConvertFromInvariantString(args[1]));
pdc_h.SetValue (wc, pdc_h.Converter.ConvertFromInvariantString(args[2]));
System.Diagnostics.Trace.WriteLine (
String.Format ("Javascript requesting size change to w:{0} h:{1} for control {2}.", args[1], args[2], args[0]));
return string.Empty;
}