troubleshooting Question

C# MVC Auto completed issue

Avatar of ukerandi
ukerandiFlag for United Kingdom of Great Britain and Northern Ireland asked on
.NET MVC.NET ProgrammingC#* ASP.NET Core
19 Comments1 Solution13 ViewsLast Modified:
Hi Experts,

I have issue with my code. But when i'm debugging and i can see records are coming but it's not properly display in the web page

See debug results

Jquery example from  :
@section Scripts {
             $(function () {
            var availableTags = [
                source: 'api/JobSearch/search'



    @{await Html.RenderPartialAsync("_ValidationScriptsPartial"); }

Open in new window

but if I replace with this  Source :

Open in new window

it will work for availableTag Array. 
  <div class="form-group">

        <div class="col-md-12">
            @Html.EditorFor(model => model.JobNumber, new { htmlAttributes = new { @class = "form-control" } })


Open in new window

    public class JobSearchController : ControllerBase
        public JobSearchController()
        public async Task<IActionResult> Search()


                string term = HttpContext.Request.Query["term"].ToString();
                SqlConnection con = new SqlConnection(connectionname);
                //select the Job number

                SqlCommand jobSqlCommand = con.CreateCommand();
                jobSqlCommand.CommandText = "FindJobNumbersp";
                jobSqlCommand.CommandType = CommandType.StoredProcedure;
                jobSqlCommand.Parameters.Add("@Search", SqlDbType.NVarChar).Value = term;
                List<jobDetails> Joblist = new List<jobDetails>();
                SqlDataAdapter da = new SqlDataAdapter(jobSqlCommand);
                DataSet ds = new DataSet();
                foreach (DataRow dr in ds.Tables[0].Rows)

                    Joblist.Add(new jobDetails
                        JobNumber = dr["job"].ToString()

                    ); ;

                return Ok(Joblist);

            catch (Exception)

                return BadRequest();


Open in new window

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>@ViewData["Title"] - TestJquery</title>
    <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
    <link rel="stylesheet" href="~/css/site.css" />
    <link href="~/lib/jquery-ui-1.12.1.custom/jquery-ui.min.css" rel="stylesheet" />
    <link href="~/lib/datetimepicker-master/datetimepicker-master/build/jquery.datetimepicker.min.css" rel="stylesheet" />

    <link rel="stylesheet" href="//">

    <link rel="stylesheet" href="">
    <link rel="stylesheet" href="//">
    <link rel="stylesheet" href="/resources/demos/style.css">


Open in new window


<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>

Open in new window

if anyone can show why is data is not displaying ,i will really appreciated.

Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 19 Comments.
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>


Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 19 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004