简体   繁体   中英

manually updating database table values are not reflecting in webpage - aspnet mvc

i noticed some wierd problem ie 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);
   }

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM