Button Contol

G

Guest

I have an asp.net app that updates SQL server and AD, I wanted to disable the "SAVE" button when its clicked until all data are saved. so I did the followin
in the Page_Loa
If Page.IsPostBack = True The
btnOK.Enabled = Fals
End i
in the btnSave_Clic
btnOK.Enabled = Fals
call SaveSQL(
call SaveAD(
btnOK.Enabled = Tru
for some reason, the disable (Enabled=false) does not work. any idea why??
Than
 
P

Peter Rilling

Because everything run by ASP.NET is synchronous, meaning that one line of
code must complete before the next. If you disable a button, it is disabled
in the ASP.NET object on the server, but remember, the page is not rendered
until all code has finished executing on the server (for the most part).
Now, if the problem is that the buttons still exist on the page after you
clicked a button, this probably has to do with the fact that IE does not
necessarily update the screen until it gets something back from the server.
You may need to disable the button via client script.

MoeJoe said:
I have an asp.net app that updates SQL server and AD, I wanted to disable
the "SAVE" button when its clicked until all data are saved. so I did the
following
 
G

Guest

Thanx for your repl

----- Peter Rilling wrote: ----

Because everything run by ASP.NET is synchronous, meaning that one line o
code must complete before the next. If you disable a button, it is disable
in the ASP.NET object on the server, but remember, the page is not rendere
until all code has finished executing on the server (for the most part)
Now, if the problem is that the buttons still exist on the page after yo
clicked a button, this probably has to do with the fact that IE does no
necessarily update the screen until it gets something back from the server
You may need to disable the button via client script

MoeJoe said:
I have an asp.net app that updates SQL server and AD, I wanted to disabl
the "SAVE" button when its clicked until all data are saved. so I did th
followin
 
S

Shaul Feldman

Hi,
I'm not sure what exactly you need, but from what you have written, I'd try
to disable the button on the client side with JavaScript code right on the
click, and at the server side emable it back when you've done with your
server logics.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top