Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                return;
            }
            GetUserProfileTableAdapter gp = new GetUserProfileTableAdapter();
            DataTable dt = new DataTable();

            dt               = gp.GetUserProfile(Session["UserLogin"].ToString());
            UserName.Text    = dt.Rows[0][0].ToString();
            UserReg.Text     = dt.Rows[0][1].ToString();
            UserDept.Text    = dt.Rows[0][2].ToString();
            UserCourse.Text  = dt.Rows[0][3].ToString();
            YearOfStudy.Text = dt.Rows[0][4].ToString();
            UserEmail.Text   = dt.Rows[0][5].ToString();
            UserSign.Attributes.Add("src", dt.Rows[0][6].ToString());

            ValidationSettings.UnobtrusiveValidationMode = UnobtrusiveValidationMode.None;
            if (Session["UserLogin"] == null)
            {
                Response.Redirect("~/Index.aspx");
            }

            if (Session["UserLogin"] != null)
            {
                GetUserNameTableAdapter gu = new GetUserNameTableAdapter();
                object Result = gu.GetUserName(Session["UserLogin"].ToString());

                string res = Convert.ToString(Result);
                username_txt.Text   = res;
                Session["UserName"] = res;
            }
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ValidationSettings.UnobtrusiveValidationMode = UnobtrusiveValidationMode.None;
            if (Session["UserLogin"] == null)
            {
                Response.Redirect("~/Index.aspx");
            }
            if (Page.IsPostBack)
            {
                return;
            }
            if (Session["UserLogin"] != null)
            {
                GetUserNameTableAdapter gu = new GetUserNameTableAdapter();
                object Result = gu.GetUserName(Session["UserLogin"].ToString());

                string res = Convert.ToString(Result);
                username_txt.Text   = res;
                Session["UserName"] = res;
            }

            FillVenue();
        }