Ben Luik
Ben Luik

Reputation: 27

Why doesnt 'ListBox1_SelectedIndexChanged' even occur when i select item from the list?

I wrote code in C# for ASP.Net website , but when i select one item from the list above even doesn't occur and the execution goes back to Site.Master. I have to put a button to fetch the item from the list, how can i make that even occur when i select the item from list?

Upvotes: 1

Views: 500

Answers (1)

Grant Thomas
Grant Thomas

Reputation: 45058

Assuming you're not using UpdatePanel controls, it should be as simple as setting the AutoPostBack property of your list to true. If this is false then the event won't occur until the form is submitted otherwise.

<asp:ListBox AutoPostBack="true" ...>

Upvotes: 1

Related Questions