asp.net mvc - How to maintain devexpress gridview data for each call back function without using static variable -


i have written following code datagrid. controller:

public class employeecontroller : basecontroller {      public static list<employeemodel> employees { get; set; }    public actionresult employeesearchpartial()     {         return partialview("employeesearchpartial", employees);     } 

}

employeesearch partial view

@html.devexpress().gridview( settings => {     settings.name = "gvemployeesearch";     settings.keyfieldname = "employeeid";      settings.settingspopup.editform.width = 600;      settings.callbackroutevalues = new { controller = "employee", action = "employeesearchpartial" };     settings.width = 720;     settings.height = 600;      settings.settingspager.pagesize = 15;      settings.settings.verticalscrollbarstyle = devexpress.web.aspxgridview.gridviewverticalscrollbarstyle.standard;     settings.settings.verticalscrollableheight = 350;     settings.controlstyle.paddings.padding = system.web.ui.webcontrols.unit.pixel(0);     settings.controlstyle.border.borderwidth = system.web.ui.webcontrols.unit.pixel(0);     settings.controlstyle.borderbottom.borderwidth = system.web.ui.webcontrols.unit.pixel(1);     settings.settingstext.emptydatarow = "";     settings.settingsbehavior.allowfocusedrow = true;     settings.clientsideevents.rowclick = "oncellclick";     settings.columns.add(column =>     {         column.caption = "employee name";         column.fieldname = "name";         column.width = 420;     });     settings.columns.add(column => {     column.caption = "employee number";     column.fieldname = "employeeid";     column.width = 300; });         }      ).bind(model).gethtml() 

now in above code grid use callback function sorting, filaring other functionality. when grid call callback function new object created employeecontroller maintain employee datascrouse (employees) whe have create static variable in controller maintain grid datascrouse list. ok single user when multiple user access page grid value conflict because mvc web application multiple user can access same page @ same time.

please tell me solution maintain grid view data in each call function.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -