Databases Reference
In-Depth Information
FIGURE 1.8
Dynamic Data field templates.
The last bit of magic this page needs is a Page_Init event handler in the code-behind to
associate a MetaTable object describing the Products table with the FormView control, as
shown in Listing 1.6.
LISTING 1.6
DynamicControl and Field Template Sample (Code-Behind)
using System;
using System.Web.DynamicData;
namespace WebApplication.Samples.Ch01.FieldTemplate
{
public partial class SamplePage : System.Web.UI.Page
{
protected void Page_Init(object sender, EventArgs e)
{
MetaTable table = Global.DefaultModel.GetTable(this.dataSource.EntitySetName);
this.formView.SetMetaTable(table);
}
}
}
 
Search WWH ::




Custom Search