开发者

how to add link button in the listbox control in asp.net

I want to add link b开发者_Go百科utton inside the listbox..... For every item i want add one link button to display something which i want....


Then I'd say that you don't want to use a listbox. Surely a simple grid control would be more appropriate??


protected void Page_Load(object sender, EventArgs e)
{
    string[] array1 = Directory.GetDirectories(Request.PhysicalApplicationPath+"Photo Galary");// so for each logical drive make this call

    // Display all folders.
    LinkButton btn;
    foreach (string name in array1)
    {
        btn = new LinkButton();
        btn.Text = name;
        btn.Click += new EventHandler(this.btnclk_Click);
        ListBox2.Controls.Add(btn);

    }
}
public void btnclk_Click(object sender, EventArgs e)
{

}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜