protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["user"] == null) { pnlBeforeLogin.Visible = true; } else { pnlAfterLogin.Visible = true; string[] fullName = MemberDB.getMemberbyEmail(Session["user"].ToString()).Name.Split(' '); lblUsername.Text = " " + fullName[0]; } ddlCategory.DataSource = CategoryDB.getAllCategory(); ddlCategory.DataBind(); ddlLocation.DataSource = LocationDB.getAllLocation(); ddlLocation.DataBind(); ddlLocation.Items.Insert(0, new ListItem("Singapore", "")); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ddlCategory.DataSource = CategoryDB.getAllCategory(); ddlCategory.DataBind(); ddlLocation.DataSource = LocationDB.getAllLocation(); ddlLocation.DataBind(); ddlLocation.Items.Insert(0, new ListItem("Singapore", "")); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["user"] == null) { Session["pageRedirectAfterLogin"] = Request.RawUrl; Response.Redirect("Login.aspx"); return; } ddlMRTLocation.DataTextField = "name"; ddlMRTLocation.DataValueField = "name"; ddlMRTLocation.DataSource = LocationDB.getAllLocation(); ddlMRTLocation.DataBind(); }