protected void Page_Load(object sender, EventArgs e) { id = Convert.ToInt64(Request.QueryString["id"]); if (!IsPostBack) { this.View.DataTextField = "show"; this.View.DataValueField = "val"; this.View.DataSource = atbll.GetCalendarField().FirstOrDefault(_ => _.Key == "View").Value; this.View.DataBind(); this.View.SelectedIndex = 0; if (id > 0) { action = new GeneralBLL().GetSingleGeneral(id); if (action == null) { Response.Write("<script>alert('获取市场相关信息失败,无法修改!');window.close();self.opener.location.reload();</script>"); } else { this.Name.Text = action.name.ToString(); this.View.SelectedValue = action.parent_id.ToString(); if (action.is_active > 0) { this.Active.Checked = true; } else { this.Active.Checked = true; } } } else { this.Active.Checked = true; } } }