Drop down list OnSelectedIndexChanged without .aspx page
Submitted by sami on Mon, 07/28/2008 - 09:45
Sharepoint is very keen on using CAML to add controls to your pages. Which means the traditional way of adding an event handler to your asp:DropDownList tag isn't available. (as far as I can tell, anyway.)
So, here's how to work around this in your code behind:
ddlSort.AutoPostBack = true;
ddlSort.SelectedIndexChanged += new EventHandler(ddlSort_SelectedIndexChanged);
this.Controls.Add(ddlSort);



