Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to cache from client side?
    primarykey
    data
    text
    <p>I have done a keyword searching in asp.net mvc3 application. A textbox with autocompletion in server side is the main item here. But the problem is when 2 users working with same application will get the search result of the other one due to server side caching. Here is my server side coding..</p> <pre><code>function AutoComplete() { AccessService({ url: "/Home/AutoFill", type: "GET", asyncAction: false, contentType: "application/json", dataType: "json", success: function (data) { var inputArray = data.workOrderNos.split('ß'); $('#txt_keyword').autocomplete({ source: inputArray, minLength: 1 }); } }); } </code></pre> <p>In HomeController:</p> <pre><code>public JsonResult AutoFill() { string _workOrderNos = _iManagePropertyMaintenances.GetAllWorkOrderNumbers(); //Will retrieve all values return Json(new { workOrderNos = _workOrderNos }, JsonRequestBehavior.AllowGet); } </code></pre> <p>How can I do that autocompletion and searching through client side?? so that different users get the result of their own search criteria??</p> <pre><code> private string UserViceSearchCriteriaName = "WorkOrderSearchCriteria" ; public ActionResult ViewWorkOrders(string criteria) { if (criteria != "") { if (HttpContext.Cache[UserViceSearchCriteriaName] != null) HttpContext.Cache[UserViceSearchCriteriaName] = criteria; else HttpContext.Cache.Add(UserViceSearchCriteriaName, criteria, null, Cache.NoAbsoluteExpiration, new TimeSpan(1, 0, 0), CacheItemPriority.Normal, null); ViewData["WorkOrderSearchCriteria"] = HttpContext.Cache[UserViceSearchCriteriaName].ToString(); } } </code></pre> <p>this way we are tracking the criteria (value in text box)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload