Disabling objects on a web page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I've got a .NET web application and once a user presses a certain button the the page I'd like to disable other buttons straight away so that the user can't press anything else while calculations are performed. I realise that if I put code to disable other buttons at the start of my button press procedure then it doesn't actually happen until the page refreshes, which is after the calculations are performed. Is there anyway to get around this

Thanks for your help

Jo
 
You can write simple client side scripts to disable the controls. If you try
to disable the controls in your server side code (your code behind), it will
get executed on the server when the postback occurs and will be reflected in
the browser when the page is refreshed with new data. What you need is to
write client side script for your web controls/server side controls.

James

Jo said:
Hi,

I've got a .NET web application and once a user presses a certain button
the the page I'd like to disable other buttons straight away so that the
user can't press anything else while calculations are performed. I realise
that if I put code to disable other buttons at the start of my button press
procedure then it doesn't actually happen until the page refreshes, which is
after the calculations are performed. Is there anyway to get around this?
 
ok, but i need the buttons to be re-enabled once the server side code finishes executing - how can I incorporate that into client side code on a single button click

----- James P wrote: ----

You can write simple client side scripts to disable the controls. If you tr
to disable the controls in your server side code (your code behind), it wil
get executed on the server when the postback occurs and will be reflected i
the browser when the page is refreshed with new data. What you need is t
write client side script for your web controls/server side controls

Jame

Jo said:
the the page I'd like to disable other buttons straight away so that th
user can't press anything else while calculations are performed. I realis
that if I put code to disable other buttons at the start of my button pres
procedure then it doesn't actually happen until the page refreshes, which i
after the calculations are performed. Is there anyway to get around this
 
No, you don't need to re-enable the buttons. When the page is refereshed with new data, those controls will become enable again, unless you disable them in your code behind.
 
Back
Top