public CascadingDropDownNameValue[] GetBanks(string knownCategoryValues, string category, string contextKey) { List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>(); List<BankEntity> list = new BankMapper().ListWithAdvancedFilter("", StatusEnum.Active); foreach (BankEntity ent in list) { CascadingDropDownNameValue cdnv; if (ent.Title == contextKey) { cdnv = new CascadingDropDownNameValue(ent.Title, ent.Id.ToString(), true); } else { cdnv = new CascadingDropDownNameValue(ent.Title, ent.Id.ToString()); } values.Add(cdnv); } return values.ToArray(); }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["BankId"] != null) { if (!IsPostBack) { BankEntity entity = new BankMapper().Get(new BankEntity() { Id = Convert.ToInt32(Request.QueryString["BankId"]) }); if (entity != null) { TitleTextBox.Text = entity.Title; OtherInfoTextBox.Text = entity.Description; } else { Response.Redirect("List.aspx"); } } } else { Response.Redirect("List.aspx"); } }