Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

3 The distinction between microeconomics and macroeconomics.

Answered: 1 week ago