We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

AutocompleteTextBox error in JS

I created AutocompleteTextBox with ClientSideTemplate.

--------------------
CONTROLLER CODE
--------------------
public class HomeController : Controller
{
public ActionResult Index()
{
var myModel = new AutocompleteTextBoxModel
{
RequestMapper = "Home/GetTemplate",
ClientSideTemplate = "visitingCard",
JSONMode = true,
Mode = AutocompleteTextBoxModel.ModeType.Get
};

ViewData["myAutocomplete"] = myModel;
return View();
}

public JsonResult GetTemplate(string queryString)
{
var list = new List
{
new MyItem{ Id = 1, Name = "Test 1"},
new MyItem{ Id = 2, Name = "Test 2"},
new MyItem{ Id = 3, Name = "Test 3"},
new MyItem{ Id = 4, Name = "Test 4"},
new MyItem{ Id = 5, Name = "Test 5"}
};

var filteredData = from suggestion in list
where suggestion.Name.ToLower().StartsWith(queryString.ToLower())
select new
{
UiId = suggestion.Id,
UiName = suggestion.Name
};

return Json(filteredData, JsonRequestBehavior.AllowGet);
}
}

public class MyItem
{
public int Id;
public string Name;
}

--------------------
CHTML CODE
--------------------



  • {{UiName}}



@{ Html.Syncfusion().AutocompleteTextBox("myAutocomplete").Render(); }
--------------------

But when i type text in text field I have error
"
h is not a constructor
http://localhost:60845/Scripts/MicrosoftAjax.js
Line 5
"

Please see code in attach.

What am I doing wrong?



AutoComp_e6695134.zip

11 Replies

AD Administrator Syncfusion Team March 12, 2012 01:53 PM UTC

CHTML CODE
--------------------



  • {{UiName}}



@{ Html.Syncfusion().AutocompleteTextBox("myAutocomplete").Render(); }




VR Varalakshmi R.S Syncfusion Team March 13, 2012 09:36 AM UTC

Hi Mikhail,

Thanks for contacting Syncfusion forums.

We have checked the sample and found that the reference of MicrosoftAjaxTemplates script file is missing in _Layout.cshtml file. So we suggest you to include the following script reference to get rid of this issue.


MicrosoftAjaxTemplates script file should be available in scripts folder.



We have also modified the attached sample and the modified sample can be downloaded from the following link,
AutoComp_e6695134644579830.zip

Kindly try the sample and let us know if it works.

Thanks,
Varalakshmi





AD Administrator Syncfusion Team March 13, 2012 10:41 AM UTC

All works good. thanks.

But if I use jquery-1.7.1.min.js (before I used jquery-1.4.4.min.js) I have different error.

What Jquery srpipt version need use with Syncfusion components?



AutoComp_20120313_893ed2a9.zip


VR Varalakshmi R.S Syncfusion Team March 14, 2012 06:06 AM UTC

Hi Mikhail,

Thanks for the update.

We have checked your sample in our environment and we found no issues with the attached sample. The sample works fine without throwing any error. Currently, we are using jQuery 1.4 and jQuery-ui 1.8 in our code library and you can use any versions of script files with Syncfusion controls.

Thanks,
Varalakshmi




AD Administrator Syncfusion Team March 14, 2012 07:11 AM UTC

Hi Varalakshmi

When I open the list (click on the dropdown arrow in) and select one of the options I get the error.

In attach example for this.
In attach image with error



AutoComp_20120314_519ed341.zip


VR Varalakshmi R.S Syncfusion Team March 15, 2012 12:29 PM UTC

Hi Mikhail,

Thanks for sharing the details with us.

We just downloaded the attached sample and run the sample in our environment and we do not get any error when we click on dropdown button and select a item from the list. We have also recorded a video which showcase the behavior of the auto complete text box and the video can be downloaded from the following link,
auto1632580172.zip
Kindly refer the video and if the issue exists still could you please provide us a scenario to isolate this issue?

Regards,
Varalakshmi




AD Administrator Syncfusion Team March 19, 2012 07:27 AM UTC

Hello.
In the attached file, I made ​​a video of how I got the error.
Please see this.

All errors display on "console" tab in FF.



20130319 (code+video)_6bbfc300.zip


VR Varalakshmi R.S Syncfusion Team March 19, 2012 12:10 PM UTC

Hi Mikhail,

We regret to let you know that we are unable to download the sample which you provided in your previous update. Can you please share us the proper link to download the sample?

Regards,
Varalakshmi




AD Administrator Syncfusion Team March 20, 2012 06:45 AM UTC

Hello.

Please see file in attach.



20130319_bb98bf6e.zip


VR Varalakshmi R.S Syncfusion Team March 20, 2012 07:06 AM UTC

Hi Mikhail,

We are able to see the error in the console. Currently, we are working on this and will update more details regarding this error on 23'rd March,2012.

Thanks,
Varalakshmi



VR Varalakshmi R.S Syncfusion Team March 23, 2012 11:38 AM UTC

Hi Mikhail,

Thanks for your patience.

This issue occurs only when jQuery1.7 file is referenced and this is confirmed as a defect. Please create a new incident to get the patch for this issue fix.

Regards,
Varalakshmi



Loader.
Live Chat Icon For mobile
Up arrow icon