javascript - Disabling aspxgridviews on server-side, how to handle on client-side? -


i've started project our ba guy needs me disable of our aspxgridviews past time.

c#      public void cutoffdatetime()       {           //datetime today = datetime.now; // live code           datetime today = new datetime(2016, 4, 15, 7, 00, 00); // testing           datetime cutoff = new datetime(2016, 4, 19, 7, 00, 00);            if (today >= cutoff.adddays(7))           {               cutoff = cutoff.adddays(7);           }           // if today past cutoff, disable grids           if (today < cutoff.addhours(-55))           {               gvproduction.enabled = false;               gvproductionsummary.enabled = false;               gvdowntimesummary.enabled = false;               gvnonprod.enabled = false;               cbcutoff.checked = false;           }           else               cbcutoff.checked = true;     } 

the grids disabled correctly, affects client-side code calls grid.refresh() methods.

i've added checkbox invisible control can interface client-side , i'm trying add:

js     if (cbcutoff.getchecked()==true)         grid.refresh(); 

but still getting javascript runtime errors stating 'cbcutoff undefined' can't think of way accomplish task.

thanks

edit:

here part of asp.net markup i'm trying fix via dexexpress' getchecked() method returns true if checked:

aspx

<clientsideevents activetabchanged="function(s, e) {     if (e.tab.index.tostring() ==  1 && cbcutoff.getchecked()==true)         gridproductionsummary.refresh(); }" /> 

fixed using

    if (cb.getchecked()) grid.refresh(); 

and set checkbox enabled on server-side


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -