1

I have a DropDownList that allows users to make selections. These selections result in a table being populated.

This all works fine when users select different values. However, I woudl like to refresh the table even when the user selects the same value.

Does anyone know what event on the ASP.Net DropDownList that I can use for this?

My DropDownList looks like:

<asp:DropDownList ID="ddlClient" runat="server" AutoPostBack="True">
    <asp:ListItem Value="1">1</asp:ListItem>
    <asp:ListItem Value="2">2</asp:ListItem>
    <asp:ListItem Value="3">3</asp:ListItem>
    <asp:ListItem Value="4">4</asp:ListItem>
</asp:DropDownList>

Thanks
Alan

2 Answers2

1

You can place a refresh Button next to the DropDownList and write your logic inside its Click event handler too.

It would be easier to the user to click the Button than selecting the same item from the DropDownList.

Akram Shahda
  • 14,655
  • 4
  • 45
  • 65
  • Out of the answers linked below and this question, this is the best answer. ie: It cannot be done directly via asp.net and code-behind as there is no trigger to issue a postback. The user has to click something else to force the dropdownlist to "reset". – Fandango68 Jun 25 '15 at 04:00
0

Here is your answer:

DropDownList annoyance: same value won't trigger event

Community
  • 1
  • 1
Alex Aza
  • 76,499
  • 26
  • 155
  • 134
  • Thanks but my values are all unique. In my case when the user selects "option 1" then clicks "option 1" again I want the event handler for the DropDownList to be triggered. –  May 25 '11 at 08:00