Question: l am trying to switich form int to string as below code on ASP.net public ActionResult Search() { var enrollemnt = Search(); return PartialView(enrollemnt); }

l am trying to switich form int to string as below code on ASP.net

public ActionResult Search() { var enrollemnt = Search(); return PartialView(enrollemnt); } private List Getenrollemnt(string serachstring) { return db.Enrollments.Where(a => a.EnrollmentSemester.Contains(serachstring)).ToList(); }

when l do the serach the serach is not seraching

l am trying to switich form int to string as below code

this is partil view for the enrollemnt as below

@model IEnumerable

    @foreach (var item in Model) {
  • @item.AssignedCampus
  • @item.Course
  • @item.CourseId
  • @item.EnrollmentId
  • @item.EnrollmentSemester
  • @item.EnrollmentYear
  • @item.Grade
  • @item.IsActive
  • }

and this the index as below

@model IEnumerable

@{ ViewBag.Title = "Index"; }

Index

Student Search
@using ( Ajax.BeginForm("Search by ", "enrollment", new AjaxOptions { InsertionMode = InsertionMode.Replace, HttpMethod = "Get", UpdateTargetId = "searchresults", LoadingElementId = "ajax-loder", OnFailure = "searchfailed" } ) ) { }

@Html.ActionLink("Create New", "Create")

@foreach (var item in Model) {

}

@Html.DisplayNameFor(model => model.Course.Title) @Html.DisplayNameFor(model => model.Student.LastName) @Html.DisplayNameFor(model => model.Grade) @Html.DisplayNameFor(model => model.IsActive) @Html.DisplayNameFor(model => model.AssignedCampus) @Html.DisplayNameFor(model => model.EnrollmentSemester) @Html.DisplayNameFor(model => model.EnrollmentYear) @Html.DisplayNameFor(model => model.Notes)
@Html.DisplayFor(modelItem => item.Course.Title) @Html.DisplayFor(modelItem => item.Student.LastName) @Html.DisplayFor(modelItem => item.Grade) @Html.DisplayFor(modelItem => item.IsActive) @Html.DisplayFor(modelItem => item.AssignedCampus) @Html.DisplayFor(modelItem => item.EnrollmentSemester) @Html.DisplayFor(modelItem => item.EnrollmentYear) @Html.DisplayFor(modelItem => item.Notes) @Html.ActionLink("Edit", "Edit", new { id = item.EnrollmentId }) | @Html.ActionLink("Details", "Details", new { id = item.EnrollmentId }) | @Html.ActionLink("Delete", "Delete", new { id = item.EnrollmentId })

@section scripts { } the requremnt is to add

Adding an Ajax Form to include Search functionality to the Enrollment Index View.

Add functionality to "Search by Student"

Add functionality to "Search by Course" -

l am not able to fix the issues to do the serch by student or coures and where is the issues

Application name Index Course Search search Create New Course Title Description Number of Credits IT2030 Asp.net 4 Edit | Details | Delete IT2320 Internet Edit | Details | Delete Application name Index Course Search search Create New Course Title Description Number of Credits IT2030 Asp.net 4 Edit | Details | Delete IT2320 Internet Edit | Details | Delete

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!