开发者

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

开发者 https://www.devze.com 2022-12-26 18:22 出处:网络
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.

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

精彩评论

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

关注公众号