I am experimenting with caching data and failing. As you can see in the code below, I call on a web service to return an array called 'categories'. This call is successful and I get the information back after creating a dropdown list with results , I include the information to store in the cache. On page refresh (I think I should say anything other than a postback), I check the cache to see if there is information that it never happens, slip my head over this one ...
if (! IsPostBack) // See that the results are cached or not with the arrays and to check the blank, you have to check the // array before checking your elements. String [] saveCatList = Cache.Get ("Categories" + session ["sessionID"]) string as []; If (saveCatList == faucet; string; isal arty (saving catalyst [0])) {WBDEMOReference.getcatlist_itemcategories [] categories; StrResult = callWebServ.getcatlist (session ["sessionID"]. ToString (), outside strRultulttext, outside dNumOfCat, out categories); (Id = 0; ii and lt; categories; langti; i ++) {// DDCT category drop down list DDCAT.ITs.Ed (IDE categories [i] .categorydesc.ToString () ID number Is, categories [i] .categorynumber.ToString ())); } // store the array in the carrier. 'Cache. Remove 'will remove the cache for that key cache. Insert ("Categories" + Session ["session ID"], Categories, blank, DateTime.Now Additional Menu (5), System.web.caching.kay.No Slipping Aspiration); }}
I think Sesoni has received it in the comments. You insert an array of categories ( WBDEMOReference.getcatlist_itemcategories ) in the cache, but do a code as [] as when you take it back Bike will be the result of a kind of mismatch faucet in the form of keywords. Try to change as string [] as like WBDEMOReference.getcatlist_itemcategories [] or check a check to see if it is without using String [] is present.
Comments
Post a Comment