473,396 Members | 1,927 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Button Contol

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
Nov 18 '05 #1
3 1138
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" <an*******@discussions.microsoft.com> wrote in message
news:8D**********************************@microsof t.com...
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 in the Page_Load
If Page.IsPostBack = True Then
btnOK.Enabled = False
End if
in the btnSave_Click
btnOK.Enabled = False
call SaveSQL()
call SaveAD()
btnOK.Enabled = True
for some reason, the disable (Enabled=false) does not work. any idea why??? Thanx

Nov 18 '05 #2
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" <an*******@discussions.microsoft.com> wrote in messag
news:8D**********************************@microsof t.com..
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 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 ide why?? Than

Nov 18 '05 #3
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.

--
With the best wishes,
Shaul Feldman
"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:eu**************@TK2MSFTNGP10.phx.gbl...
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" <an*******@discussions.microsoft.com> wrote in message
news:8D**********************************@microsof t.com...
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
in the Page_Load
If Page.IsPostBack = True Then
btnOK.Enabled = False
End if
in the btnSave_Click
btnOK.Enabled = False
call SaveSQL()
call SaveAD()
btnOK.Enabled = True
for some reason, the disable (Enabled=false) does not work. any idea

why???
Thanx


Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Skip Hollowell | last post by:
I am working on a menu bar for a site, and am using buttons in the bar (because the customer wants to use accessKeys for each selection, apparently it is too much work to click on them with a...
25
by: KK | last post by:
Hi, I am using history.go(-1) for implementing the back button functionality. Its working fine but with this exception. 1. The page which is having back button has some hyperlinks on it. ...
3
by: Zürcher See | last post by:
Someone has implemented a Datagrid Button for the Windows.Form?
18
by: jrhoads23 | last post by:
Hello, I am trying to find a way to tell if an .NET windows forms Button (System.Windows.Forms.Button) is "depressed" (pushed down). For my application, I can not use a check box control set to...
1
by: Tim | last post by:
Hi All, I have a form that I dynamically build putting various text boxes and lables on it based on a SQL query. When a user clicks the submit button, the form clears it's self and is left with...
18
by: Colin McGuire | last post by:
Hi - this was posted last weekend and unfortunately not resolved. The solutions that were posted almost worked but after another 5 days of working on the code everynight, I am not further ahead....
0
by: pushpi | last post by:
Hi, i'm using the Treeview contol in asp.net 2.0 (present in VS2005 toolbox). i'm having checkboxes for all the nodes in the treeview.All i want to have is that On Checking a checkbox for a...
1
by: stephen | last post by:
Hi, Can we have a tab contol on a webform just like windows application? if yes, can you please point me to the article. Thanks, Stephen
3
by: chandan | last post by:
Hi, Is any way to palce a control(button/label) at a location on webPage in runtime?? In page_load envet I am adding a button on the page in the contol collection of a panel but not able to...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.