【发布时间】:2014-10-26 12:40:03
【问题描述】:
我正在尝试使用 Jquery Autocomplete 向我的 WS 发送 2 个参数:
- 文本框,我想要完成的地方
- 下拉列表索引
我在获取下拉列表索引时遇到了问题,因为我只得到了控制器的名称。
这是我的脚本:
<script type="text/javascript" language="javascript">
$(function() {
$('#<%= TextBoxes1.ClientID%>').autocomplete({
source: function (request, response) {
$.ajax({
url: "WB/EmployeeService.asmx/GetEmpolyeeId",
data: "{ 'Text': '" + request.term + "','SelectedIndex':'" + '#<%= DP1.ClientID %>' + "'}",
type: "POST",
dataType: "json",
contentType: "application/json;charset=utf-8",
success: function (result) {
response(result.d);
},
error: function (response) {
alert(response.responseText);
},
failure: function (response) {
alert(response.responseText);
}
});
},
minLength: 0
});
});
</script>
这是我的 WS:
public List<string> GetEmpolyeeId(string Text, string SelectedIndex)
我需要做什么才能让它工作?
【问题讨论】:
标签: javascript c# jquery asp.net web-services