天天看点

动态设置HyperLink的属性

for(int i=0;i<ds.Tables[0].Rows.Count;i++)

    {  

     ((HyperLink)this.FindControl("HyperLink"+i)).Visible = true;

     ((HyperLink)this.FindControl("HyperLink"+i)).Text = ds.Tables[0].Rows[i]["ProductName"].ToString();

     ((HyperLink)this.FindControl("HyperLink"+i)).NavigateUrl = SooFun.Components.Globals.ApplicationPath +"Apeak/SupplyProductInfo/Showproduct.aspx?ID="+ ds.Tables[0].Rows[i]["ProductName"].ToString();

    }