02
01/18
FormDiy.NET自定义表单框架(二):动态创建控件
// 动态创建控件 // 注意:这段代码需要每次加载页面都执行,因此不能放在 if(!IsPostBack) 逻辑判断中 protected void Page_Init(object sender, EventArgs e) { var fieldList = db.Fields.Where(f => f.FormId == 1).OrderBy(f => f.Order).ToList(); foreach (var field in fieldList) { Panel panel = new Panel(); panel.ID = "panel" + field.Id; panel.ShowBorder = false; ...