public static void Update(this Control self)
{
if (self is Component)
{
((Component)self).Render();
return;
}
Control parent = self.Parent;
int index = parent.Controls.IndexOf(self);
LiteralControl start = new LiteralControl("<Ext.Net.Direct.Update id=\"{0}\">".FormatWith(self.ClientID));
LiteralControl end = new LiteralControl("</Ext.Net.Direct.Update>");
parent.Controls.AddAt(index, start);
parent.Controls.AddAt(index + 2, end);
HttpContext.Current.Items["Ext.Net.Direct.Update"] = true;
}
}