Hi...
I am beginner to MVC. am trying to develop a search engine using Ajax. my project have two views and one controller.. search screen having a textbox and a search button.
if i enter the value in the text box and click search button it navigate to next page(search result page) and the textbox filled with value which we give in search screen page textbox.
(or)
 
Do you have any other idea in Search engine project example similar with my project .. kindly share with me..
 
Thanks..
 
 
Search Screen Page:
 
 
 Search Result Page:
 
@model Tuple
@{
ViewBag.Title = "Get User";
}

Search Result

Keyword :
@*textbox*@
@*search*@
@*AllSearch*@
@section Scripts{
}
 
Controller:

public ActionResult GetUser(string keyword)
{
return View(new Tuple(keyword));
}
[HttpPost]
public ActionResult GetSearch(FormCollection frm, string search)
{

return RedirectToAction("GetUser", new { keyword = frm["search"] });
}
public JsonResult GetAllUser()
{
List allUser = new List();



// Here "MyDatabaseEntities " is dbContext, which is created at time of model creation.

using (MvcApplication1Entities2 dc = new MvcApplication1Entities2())
{
allUser = dc.tblBusinessCategories.ToList();
}

return new JsonResult { Data=allUser, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
}

public JsonResult GetUserWithParameter(string prefix)
{
List allUser = new List();


// Here "MyDatabaseEntities " is dbContext, which is created at time of model creation.

using (MvcApplication1Entities2 dc = new MvcApplication1Entities2())
{
allUser = dc.tblBusinessCategories.Where(a => a.BusinessDescription.Contains(prefix) || a.BusinessName.Contains(prefix) || a.BusinessCategory.Contains(prefix)).ToList();

}

return new JsonResult { Data = allUser, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
}

}
}