1

i noticed some wierd problem i.e i have built a web page on which information comes from database table named "school", when i change some data in that table manually from mssql the web page data is still same as previous, its not gettin' changed, i dn't know how it is possible.

this is my action controller


    public ActionResult SchoolDetails(string id,_ASI_School schoolDetails)
    {
            schoolDetails = SchoolRepository.GetSchoolById(id);
            return View(schoolDetails);
     }

This is my view


    =Html.Encode(Model.SchoolName)
    = Html.Encode(Model.SchoolAddress) 
    = Html.Encode(Model.SchoolEmail) 

code for GetSchoolById()..


   private static ASIDataContext db = new ASIDataContext();
   public static _ASI_School GetSchoolById(string schoolId)
   {
            return db._ASI_Schools.SingleOrDefault(x => x.SchoolId == schoolId);
   }

9
  • 1
    Did you refresh the web page in your web browser after changing the database? Commented May 15, 2010 at 10:21
  • yes ofcourse i did that, but no use Commented May 15, 2010 at 10:58
  • @FosterZ, Probably due to a cache. Commented May 15, 2010 at 11:14
  • @Mattias Jakobsson, i cleared all cache of browser, even i tried to open in various browser, but same issue. Commented May 15, 2010 at 11:31
  • It does not seem to be a complicated scenario, so debugging it should not be too difficult for you. If you still require help, you might want to post some source code (view, controller, underlying layers) Commented May 15, 2010 at 11:38

1 Answer 1

1

try putting this above your SchoolDetails ActionResult

[OutputCache( Duration=0)]

MVC does some really nice server side caching as well that clearing the cache on the browser does not fix.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.