Кулак I Использование ASP.Net DropDownList из-за его события Thats я используюВыбор2 с ASP DROPDOWNLIST контроля с использованием Ajax и пейджинг
<asp:DropDownList ID="e24" runat="server" class="form-control select2">
<asp:ListItem Text="--إختر--" Selected="True" Value="0" />
<asp:ListItem Text="مفتوحة" Value="OPN" />
<asp:ListItem Text="مغلقة" Value="CLO" />
</asp:DropDownList>
и я хочу использовать ВЫБ.2 и использовать функцию пейджинга с осины: DropDownList
я попытался с помощью AJAX
$(document).ready(function() {
//$("#e24").select2();
$("#e24").select2({
ajax: {
url: '<%= ResolveUrl("~/ar/UserControls/WebForm1.aspx/getResults") %>',
dataType: 'json',
delay: 100,
data: function (params) {
//alert(params.page);
return {
q: params.term, // search term
page: params.page
};
},
processResults: function (data, params) {
// parse the results into the format expected by Select2
// since we are using custom formatting functions we do not need to
// alter the remote JSON data, except to indicate that infinite
// scrolling can be used
params.page = params.page || 1;
return {
results: data.items,
pagination: {
more: (params.page * 30) < data.total_count
}
};
},
cache: true
},
//escapeMarkup: function (markup) { return markup; }, // let our custom formatter work
minimumInputLength: 1,
//templateResult: formatRepo, // omitted for brevity, see the source of this page
//templateSelection: formatRepoSelection // omitted for brevity, see the source of this page
}
);
});
и C# код
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Json)]
public static String getResults(String q, String page_limit)
{
return "[{ \"id\": \"1\", \"text\": \"test\" }]";
}
Кулак ajax не стреляет и не работает !! как я могу заставить его работать я попытался это с <select\>
также, но Stile AJAX не работаю с WebMethods я просто хочу работать и приносить данные из WebMethod или из осины: DROPDOWNLIST это самостоятельно или от каких-либо наружных видных способов
, если это невозможно? как я могу сделать это с <select\>
тегом или еще