?
Solved

Asp.net mvc4

Posted on 2014-10-12
2
Medium Priority
?
139 Views
Last Modified: 2014-10-13
Hi guys ,

I have some mvc4 app and I'm trying to implement autocomplete on one of my textbox and it is not functioning.

here is my C# code and jquery:

 public JsonResult Autocompletecode(string Description)
        {
            rmsmasterdbtestEntities db = new rmsmasterdbtestEntities();
            var auto = from s in db.Items select s.Description;
            var namelist = auto.Where(n => n.ToLower().StartsWith(Description.ToLower()));

            return Json(namelist, JsonRequestBehavior.AllowGet);
        }

Open in new window


 $(function () {
            $("#Description").autocomplete({
                source: "/Ajax/Autocompletecode",
                minLength: 1,
               
            });
        });

Open in new window

0
Comment
Question by:Moti Mashiah
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Accepted Solution

by:
louisfr earned 2000 total points
ID: 40376835
Change the method parameter name to "term":
public JsonResult Autocompletecode(string term)

Open in new window

That's the default when using an url as source.
0
 
LVL 1

Author Closing Comment

by:Moti Mashiah
ID: 40377566
Great thank you.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month8 days, 20 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question