Exemple #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         Insert obj = new Insert();
         DataList1.DataSource = obj.DisplayAllProduct();
         DataList1.DataBind();  //binds data to the source
     }
 }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lblUname.Text = (Request.QueryString["id"] as string);

            if (!Page.IsPostBack)
            {
                if (Session["UserID"] == null)
                {
                    Response.Redirect("LoginForm.aspx");
                }
                Insert obj = new Insert();
                DataList1.DataSource = obj.DisplayAllProduct();
                DataList1.DataBind();  //binds data to the source
            }
        }