コード例 #1
0
 public void getDataPhai(string nguonPhai)
 {
     DataTable dt, dtTemp;
     string catName, catLink;
     zClass ob = new zClass();
     dt = ob.nsHOME(nguonPhai, out dtTemp, out catName, out catLink);
     rbPhai.Text = catName;
     if (Settings["TieuDePhai"] != null) rbPhai.Text = Settings["TieuDePhai"].ToString();
     if (rbPhai.Text == "") rbPhai.Text = catName;
     rbPhai.NavigateUrl = catLink;
     GridView3.DataSource = dtTemp;
     GridView3.DataBind();
     try
     {
         lkTieuDePhai.Text = dt.Rows[0][1].ToString();
         lkTieuDePhai.NavigateUrl = dt.Rows[0][4].ToString();
         ImagePhai.ImageUrl = dt.Rows[0][2].ToString();
         lbContentPhai.Text = dt.Rows[0][3].ToString();
     }
     catch 
     {
         lkTieuDePhai.Text = "";
         ImagePhai.Width = 0;
     }
 }
コード例 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     // Get Data
     DataTable dt, dtTemp;
     string nguon = "NEW", catName, catLink;
     if (Settings["Nguon"] != null) nguon = Settings["Nguon"].ToString();
     zClass ob = new zClass();
     dt = ob.nsHOME(nguon, out dtTemp, out catName, out catLink);
     // Bind Data
     try
     {
         txtCAT.Text = catName;
         txtCAT.NavigateUrl = catLink;
         txtIMG.ImageUrl = dt.Rows[0][2].ToString();
         txtTITLE.Text = dt.Rows[0][1].ToString();
         txtTITLE.NavigateUrl = dt.Rows[0][4].ToString();
         txtDESCRIP.Text = dt.Rows[0][3].ToString();
         if (dtTemp.Rows.Count > 0)
         {
             hl1st.Text = dtTemp.Rows[0][1].ToString();
             hl1st.NavigateUrl = dtTemp.Rows[0][2].ToString();
         }
         if (dtTemp.Rows.Count > 1)
         {
             hl2nd.Text = dtTemp.Rows[1][1].ToString();
             hl2nd.NavigateUrl = dtTemp.Rows[1][2].ToString();
         }
         if (dtTemp.Rows.Count > 2)
         {
             hl3rd.Text = dtTemp.Rows[2][1].ToString();
             hl3rd.NavigateUrl = dtTemp.Rows[2][2].ToString();
         }
         if (dtTemp.Rows.Count > 3)
         {
             hl4th.Text = dtTemp.Rows[3][1].ToString();
             hl4th.NavigateUrl = dtTemp.Rows[3][2].ToString();
         }
     }
     catch { }
 }