473,472 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

onClcik with IF Condition

RA
Is it possible to add an attribute for onClick event with an if condition.
For example. If button is enabled then popup a message "Button Enabled" and
if it is disabled popup message "Button disabled"?
Nov 18 '05 #1
4 1638
Yes, you can put any javascript code you want in there.
Or you can just a call a function that has already been defined, and let it
contain all your logic.

"RA" <rc***************@storis.com> wrote in message
news:uZ**************@TK2MSFTNGP15.phx.gbl...
Is it possible to add an attribute for onClick event with an if condition.
For example. If button is enabled then popup a message "Button Enabled" and if it is disabled popup message "Button disabled"?

Nov 18 '05 #2
RA,

As far as I know, if a button is not enabled, it can't be clicked, and
therefore nothing is fired, neither code-behind or otherwise.

Be intrigued to know if that's not the case though!

Cheers

dhnriverside

"RA" wrote:
Is it possible to add an attribute for onClick event with an if condition.
For example. If button is enabled then popup a message "Button Enabled" and
if it is disabled popup message "Button disabled"?

Nov 18 '05 #3
RA
Yes, you are right.

button does not fire click event when it is disabled; but unfortunately
dynamically created Hyperlink does.

"Dan Nash" <da*@musoswire.co.uk> wrote in message
news:94**********************************@microsof t.com...
RA,

As far as I know, if a button is not enabled, it can't be clicked, and
therefore nothing is fired, neither code-behind or otherwise.

Be intrigued to know if that's not the case though!

Cheers

dhnriverside

"RA" wrote:
Is it possible to add an attribute for onClick event with an if
condition.
For example. If button is enabled then popup a message "Button Enabled"
and
if it is disabled popup message "Button disabled"?

Nov 18 '05 #4
RA
Currently I have following code for a hyperlink control which is added to a
TableCell.
HLink.Attributes.Add("onClick", _
"return confirm('Are you Sure you want to delete " & _
"selected items?');")

With this statement eventhough I disable the link and if it has been clciked
it shows above message.

Can you please help me build a statement which only shows this message when
the link is enabled.
"Marina" <so*****@nospam.com> wrote in message
news:uF**************@TK2MSFTNGP15.phx.gbl...
Yes, you can put any javascript code you want in there.
Or you can just a call a function that has already been defined, and let
it
contain all your logic.

"RA" <rc***************@storis.com> wrote in message
news:uZ**************@TK2MSFTNGP15.phx.gbl...
Is it possible to add an attribute for onClick event with an if
condition.
For example. If button is enabled then popup a message "Button Enabled"

and
if it is disabled popup message "Button disabled"?


Nov 18 '05 #5

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

Similar topics

2
by: Kendal Goodrich | last post by:
In the setup project I am trying to create, I am wanting to search to see if DirectX 8 is installed on the local machine. I figured the best way to determine would be a registry key search, so I...
1
by: Joel | last post by:
As my registry start condition was working fine, now it's not working anymore Here are the kind of parameter I use in VSNEt2003: A) Registry : Name : Pipo; Property : PROP1; RegKey...
3
by: Ben R. | last post by:
In an article I was reading (http://www.ftponline.com/vsm/2005_06/magazine/columns/desktopdeveloper/), I read the following: "The ending condition of a VB.NET for loop is evaluated only once,...
3
by: Yohan | last post by:
Hello, I have a question concerning the template classes and their parameters. Is it possible to set a condition on the template parameters in a way that could block the compilation if the...
5
by: das | last post by:
hello all, this might be simple: I populate a temp table based on a condition from another table: select @condition = condition from table1 where id=1 in my stored procedure I want to do...
4
by: joh12005 | last post by:
Hello, i posted for suggestions a little idea even if it still needs further thoughts but as i'm sure you could help :) if would like to implement some kind of Condition class which i coud...
16
by: Claudio Grondi | last post by:
Sometimes it is known in advance, that the time spent in a loop will be in order of minutes or even hours, so it makes sense to optimize each element in the loop to make it run faster. One of...
4
by: Jane T | last post by:
I appreciate how difficult it is to resolve a problem without all the information but maybe someone has come across a similar problem. I have an 'extract' table which has 1853 rows when I ask for...
0
by: RN1 | last post by:
I have a DataGrid with an EditCommandColumn. In the EditCommand sub of the DataGrid, there is an If condition. This If condition is True for some rows in the DataGrid whereas it is False for the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
1
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.