javascript - ASP.NET AJAX postback query's the database on each UpdatePanel refresh -


i'm building webpart in c# sharepoint telerik radhtmlchart using ajax. data read using linq sql , takes while load. i'm able bind data chart , want drill down when user click on line series , refresh update panel want filter same data have in memory. ajax page postback web part , re-query's database when going thru page lifecycle.

how can query data have in memory without querying same data on , on again db? i'm thinking of avoiding postback , using javascript client side code or linq.js or making , consuming rest web service. require major changes have now. there way keep datasource state in viewdata, viewbag or session variables keep on server-side? viewbag or session

public partial class budget : usercontrol     {          static budgetdatacontext db = new budgetdatacontext("data source=mydbserver\\instance;initial catalog=db;integrated security=true");          private ienumerable<vw_budget> yeardata= (from v in db.vw_budget v.fiscalyear == "2013" select v).tolist(); //<--- gets called in each postback  ...//more code       } 

thanks,


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -