protected void Page_Load(object sender, EventArgs e) { url = HttpContext.Current.Request.Url.AbsoluteUri; Session["url"] = url; if (!IsPostBack) { dml ob = new dml(); DropDownList1.DataSource = ob.getcolordetails(); DropDownList2.DataSource = ob.getmodeldetails(); DropDownList3.DataSource = ob.getpricedetails(); DropDownList1.DataTextField = "COLOR_NAME"; DropDownList2.DataTextField = "MODEL_NAME"; DropDownList3.DataTextField = "PRICE"; DropDownList1.DataValueField = "COLOR_NAME"; DropDownList2.DataValueField = "MODEL_NAME"; DropDownList3.DataValueField = "PRICE"; DropDownList1.DataBind(); DropDownList2.DataBind(); DropDownList3.DataBind(); } if (Session["username"] != null) { //Response.ClearHeaders(); //Response.AddHeader("Cache-Control", "no-cache, no-store, max-age=0, must-revalidate"); //Response.AddHeader("Pragma", "no-cache"); LinkButton12.Visible = true; LinkButton4.Visible = false; LinkButton5.Visible = false; LinkButton10.Visible = true; LinkButton8.Visible = true; Label1.Text = "Welcome" + " " + Session["username"].ToString(); } else { LinkButton12.Visible = false; LinkButton10.Visible = false; LinkButton4.Visible = true; LinkButton5.Visible = true; LinkButton8.Visible = false; Label1.Text = ""; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //username = (string)Session["username"]; //userid = (string)Session["userid"]; dml ob = new dml(); DataTable dt = new DataTable(); dt = ob.sliderimages(); if (dt.Rows.Count > 0) { img1.Src = "http://localhost:49447/Images/" + dt.Rows[0]["PICTURE1"].ToString(); img2.Src = "http://localhost:49447/Images/" + dt.Rows[0]["PICTURE2"].ToString(); img3.Src = "http://localhost:49447/Images/" + dt.Rows[0]["PICTURE3"].ToString(); img4.Src = "http://localhost:49447/Images/" + dt.Rows[0]["PICTURE4"].ToString(); } DataList1.DataSource = ob.getmodeldetails(); DataList1.DataBind(); } }