Autocomplete combobox using webservice and entityFramework

This creates a autocomplete type of combobox.It fills the combo from database using web service and data fetch is done using entity framework. It would display the student names in a combobox. u can search the name in combobox also , it will show related matches.

The status of this resource is Pending and require some modification by the author.

<script src=""></script>
<script src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript">
function fill() {
type: "POST",
contentType: "application/json; charset=utf-8",
url: "WebService2.asmx/getStudents",
data: '{}',
dataType: "json",
success: function (Result) {
var jsdata = JSON.parse(Result.d);
// alert(jsdata);
// var jsdata = Result.d;
$.each(jsdata, function (key, value) {
$("#MySelect").combify(); // this method converts drop down to combo-box and enables auto search
error: function (Result) {

My Auto complete combobox :

<script type="text/javascript">
$(document).ready(function () {

web service method, is uses entity framework to get list of studentnames from DB and return a Json serialzed string:

public string getStudents()
CoreEntities _Contex = new CoreEntities();
var list = (from m in _Contex.tblStudentInfoes where m.int_Status == 1 select new { id = m.int_Student_Id, name = m.str_Last_Name }).ToList();
return (new JavaScriptSerializer().Serialize(list));


No responses found. Be the first to comment...

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: