protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.BaseLoad(); DataTable objects = ObjectAttribute.GetObjects(); PopulateObjects(objects); LoadObjects(objects); PopulateAttributes(); } }
// Associations protected void lbEditAttributeAssociation_Command(object sender, CommandEventArgs e) { // CommandArgument format: <AttributeId>,<AttributeName> string commandArgument = Convert.ToString(e.CommandArgument); int attributeId = Convert.ToInt32(commandArgument.Substring(0, commandArgument.IndexOf(","))); string attributeName = commandArgument.Substring(commandArgument.IndexOf(",") + 1); // save to page lblAttributeName.Text = attributeName; hidAttributeId.Value = Convert.ToString(attributeId); // get object attribute associations objectAttributeDetails = CSCore.DataHelper.BaseSqlHelper.GetDataSet(ObjectAttribute.GetAttributeObjects(attributeName)); // populate associations datalist dlAssociations.DataKeyField = "ObjectID"; dlAssociations.DataSource = ObjectAttribute.GetObjects(); dlAssociations.DataBind(); // show modal mpePopup.Show(); }