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)
{
}
精彩评论