Sunday, September 21, 2008

Assigning UserControlURL in a TabClick event

The UserControlUrl property is validated and reconstructed by ITemplate logic, which at the time of particular server event can already exist. In order to trigger reconstruction of the ITemplate and display the UserControl, the DataBind() method of UltraWebTab should be called at the end.

switch (e.Tab.Key)
{
case "UC1":
e.Tab.ContentPane.UserControlUrl= = "WebUserControl1.ascx";
UltraWebTab1.DataBind();
break;
case "UC2":
e.Tab.ContentPane.UserControlUrl== "WebUserControl2.ascx";
UltraWebTab1.DataBind();
break;
}

No comments: