G
Guest
Hi People,
I have got a simple question to ask. I am trying to build dynamic controls
in asp.net. I have managed to build them successfully. I have also managed to
add the event handlers to all controls I want to monitor. I have the
following code line: -
((CheckBox)ctl).Attributes["onclick"] =
"if(!this.checked){input_box=confirm('All changes to Test will be lost');}";
This is just enabling an action on the check box to be monitored. A
confirmation box props up. Now what I want to do is that if the user selects
ok only then I want to perform the action, but if he presses cancel, then I
do not want to do anything at all. Using this "onclick" thing how can I check
to see what the user selected. Presently it performs the action even if the
user selects cancel.
I hope you guys can help me out.
Much Thanks,
Irfan
I have got a simple question to ask. I am trying to build dynamic controls
in asp.net. I have managed to build them successfully. I have also managed to
add the event handlers to all controls I want to monitor. I have the
following code line: -
((CheckBox)ctl).Attributes["onclick"] =
"if(!this.checked){input_box=confirm('All changes to Test will be lost');}";
This is just enabling an action on the check box to be monitored. A
confirmation box props up. Now what I want to do is that if the user selects
ok only then I want to perform the action, but if he presses cancel, then I
do not want to do anything at all. Using this "onclick" thing how can I check
to see what the user selected. Presently it performs the action even if the
user selects cancel.
I hope you guys can help me out.
Much Thanks,
Irfan