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 } }
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 } }