onClcik with IF Condition

  • Thread starter Thread starter RA
  • Start date Start date
R

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"?
 
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,

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
 
Yes, you are right.

button does not fire click event when it is disabled; but unfortunately
dynamically created Hyperlink does.
 
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.
 
Back
Top