Dropdownlist onselectedindexchanged problem

I have a dropdown like this

<asp:dropdownlist runat="server" autopostback="true" onselecteditemindexchanged="fire_event" ID="DDL"/>

and on the code that I do this

page_load : if(!page.postback)I m binding data into dropdownlist
   fire_event: I am redirecting page to itemselected value.

So, I can do most of the part, everything works fine except ..

when I select an item from the drop-down list, it redirects me to the page I wanted ... but when I click on it, it remains in the same selected item. I want it to be such that it loads again when I click on it, for example.

if my dropdown looks like state A and other items

A
B
C
D

when I select D, it displays me on the page Dand when I click back it is in a state D, I want it to show AinsteadD

+3
2

"" ( ) , , , .
, , . , , IE. , Firefox no-store:

    Response.CacheControl = "no-cache";
    Response.Cache.SetNoStore();
    Response.AddHeader("Pragma", "no-cache");
    Response.Expires = -1;
+1

javascript . jquery, Microsoft Ajax...

$.ready(function() {
    $("#mySelect").val(''); // Set the default value to select here
});

!

+1

Source: https://habr.com/ru/post/1728298/


All Articles