My code is
<div class="col-md-2" id="dvabc" runat="server">
<asp:DropDownList runat="server" AutoPostBack="true" ID="ddlabc" CssClass="form-control input-sm" OnSelectedIndexChanged="ddlStateMain_SelectedIndexChanged">
</asp:DropDownList>
</div>
<asp:TextBox runat="server" ID="txtSearch" placeholder="FPS" CssClass="form-control input-sm" />
<div class="col-md-1">
<asp:Button ID="btnView" runat="server" Text="View"
CausesValidation="true" class="btn btn-primary" OnClick="btnView_Click" />
</div>
<link href="jquery-ui-1.8.21.custom.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.min.js" />
<script type="text/javascript" src="jquery-ui.min.js" />
<script type="text/javascript">
$(document).ready(function () {
SearchText();
});
function SearchText() {
var abc = $('#<%=ddlabc.ClientID%>').text;
var alloc = abc;
var tehsil = "001";
$('[id*=txtSearch]').autocomplete(
{
source: function (request, response) {
$.ajax(
{
type: "POST",
contentType: "application/json; charset=utf-8",
url: "frmPaymentByFPS.aspx/GetAutoSearchFPS",
data: "{'ddlAllocationOrderNo':'" + alloc + "','Tahsil':'" + tehsil + "','FairPriceShop':'" + extractLast(request.term) + "'}",
dataType: "json",
success: function (data) {
response(data.d);
},
error: function (result) {
alert("Error");
}
});
},
focus: function () {
return false;
},
select: function (event, ui) {
var terms = split(this.value);
terms.pop();
terms.push(ui.item.value);
terms.push("");
this.value = terms.join(", ");
return false;
}
});
$("#txtSearch").bind("keydown", function (event) {
if (event.keyCode === $.ui.keyCode.TAB &&
$(this).data("autocomplete").menu.active) {
event.preventDefault();
}
})
function split(val) {
return val.split(/,\s*/);
}
function extractLast(term) {
return split(term).pop();
}
}
</script>
This java script is working for auto search.
When I Change index of ddlabc it does not work.
If I have button also and I click button then button and ddlabc index change both fired one by one.
In vs2010, it is working fine.
I have many drop down, text box and one button.
If click button it is fired but change selection of drop down does not fired.
If I change selection then i have to click button for selection change.
Any Event except button click event does not fire.
I found the thing is that prob from master page or bootstrap.