views:

206

answers:

2

below is my dropdownlist with autopostback true now when i select prefix1 it gives me a post back but when i select it again it doesnt. I have to select prefix2 item first and then go back to prefix1 for it to postback again. Its like as if its postbacking only with SeletedIndexChange.

I need postback evrytime I choose in my dropdownlist even if its the same item:

<asp:DropDownList runat="server" ID="lstFilePrefix1" AutoPostBack="True" 
     OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"  >
    <asp:ListItem Text="Prefix1" Value="Prefix1" />
    <asp:ListItem Text="Prefix2" Value="Prefix2" />
    <asp:ListItem Text="Prefix3" Value="Prefix3" />
    <asp:ListItem Text="Prefix1 and Prefix2" Value="Prefix1 and Prefix2" />
    <asp:ListItem Text="Prefix2 and Prefix3" Value="Prefix2 and Prefix3" />
</asp:DropDownList>
+1  A: 

As the dropdownlist behviour, on selected index change, postback occur, you need to change your control selection, you can use checkbox control for that

Muhammad Akhtar
A: 

The basic nature/behavior of a drop down control is that items displayed for user selection. When user selected an item and again selecting the same item doesn't make sense to fire OnSeletedIndexChange event. In fact, there is no change in the ITEM INDEX

If this clarifies your question, please mark it.

sandeept