Reputation: 6431
I want to add multiple hyperlink control items to a asp.net listbox control. I have written below code but it is not generating required output.
lstBoxAttachments.Controls.Add(new HyperLink() { Text = someText, NavigateUrl = someURL });
Any help would be appreciated.
Upvotes: 1
Views: 2295
Reputation: 5428
A list box cannot contain hyperlinks. This is a limitation of HTML, not specific to asp.net.
Try using a repeater control instead.
Upvotes: 2