I know this question has been asked quite a bit, but nothing seems to work for me. I've read many questions and answers.
I'm using a JQuery event to handle the event of an ASP.NET control, but the event will not fire.
This is what I've tried:
My DropDownList:
<asp:DropDownList ID="List_ValueStream" runat="server" Width="195px" />
My attempts to add events to the DropDownList, all tested separately:
in:
<script src="http://code.jquery.com/jquery.min.js" type="text/javascript">
...
</script>
/
$(document).ready(function () {
$("#<%=List_ValueStream.ClientID%>").change(function () {
alert('1 Handler for .change() called.');
});
});
/
$(document).ready(function () {
$("#List_ValueStream").change(function () {
alert('2 Handler for .change() called.');
});
});
/
$(document).ready(function () {
$("#List_ValueStream").on('change', function () {
alert('3 Handler for .change() called.');
});
});
/
$("#<%=List_ValueStream.ClientID%>").change(function () {
alert('4 Handler for .change() called.');
});
/
$("#List_ValueStream").change(function () {
alert('5 Handler for .change() called.');
});
idactuallyList_ValueStream? Do you watch the console to check for JavaScript errors?<select id="List_ValueStream">ClientID$(document).ready()code inside the<script></script>tags used to load jQuery or inside a separate<script>tag after that one? If it's the former, move it to its own<script>tag.