protected void PMDropdownlist_SelectedIndexChanged(object sender, EventArgs e) { chqTxt.Text = ""; bnkTxt.Text = ""; mbTxt.Text = ""; ammTxt.Text = ""; AdvInvSystemEntities dbobj = new AdvInvSystemEntities(); if (PMDropdownlist.SelectedItem.Value == "Cheque") { bk.Visible = true; } else { bk.Visible = false; } if (PMDropdownlist.SelectedItem.Text == "Cash") { AccType = "InHand"; } else if (PMDropdownlist.SelectedItem.Text == "Cheque") { AccType = "Bank"; } IEnumerable <sp_Accounts_type_Result> AT = dbobj.sp_Accounts_type(AccType).ToList(); AccDropDownlist.DataSource = AT; AccDropDownlist.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["UserEmail"] == null && Session["UserName"] == null) { Response.Redirect("Login.aspx"); } if (!IsPostBack) { DropDownList2.DataSource = dbobj.sp_Accounts_type("InHand"); DropDownList2.DataBind(); } errorLbl.Visible = false; }