コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                HtmlGenericControl menu = (HtmlGenericControl)this.Master.FindControl("registerStudentsLink");
                menu.Attributes.Add("class", "active");

                defaultLabel.Visible = true;

                //Populate the dropdown with the list of unique classes from the DB
                ddlClasses.DataSource     = dbops.getClasses();
                ddlClasses.DataTextField  = "class";
                ddlClasses.DataValueField = "class";
                ddlClasses.DataBind();
                ddlClasses.Items.Insert(0, new ListItem("--Select Class--", "0"));
            }
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                try
                {
                    if (Session["username"] != null)
                    {
                        //do something
                    }
                    else
                    {
                        Response.Redirect("../Login.aspx");
                    }
                }
                catch (Exception ex)
                {
                    Response.Redirect("../Login.aspx");
                }
                //Make the current menu item active if it is the current page being loaded
                HtmlGenericControl menu = (HtmlGenericControl)this.Master.FindControl("registrationLink");
                menu.Attributes.Add("class", "active");

                //Disable the Webcam modules until the student information is fetched
                cameraModule.Enabled = false;
                btnSave1.Visible     = false;
                videoModule.Visible  = false;

                //Should be visible only if the student being registered is already registered
                nextRegistration.Visible = false;

                //Populate the dropdown with the list of unique classes from the DB
                ddlClasses.DataSource     = dbops.getClasses();
                ddlClasses.DataTextField  = "class";
                ddlClasses.DataValueField = "class";
                ddlClasses.DataBind();
                ddlClasses.Items.Insert(0, new ListItem("--Select Class--", "0"));
            }
        }