C
c.triffault
Greetings,
I got a usercontrol which generates LinkButton objects. I want that
when the user click on it, a "confirm" javascript is generated.
After reading
http://groups.google.co.uk/group/mi...avascript+&qt_g=1&searchnow=Search+this+group
I did this :
deleteLink.Attributes["onclick"]="confirmCustom(this)";
in my aspx page, I got a function named confirmCustom :
function confirmCustom(source)
{
answer = confirm("are you sure ? ");
if (answer==false) {
temporaryHref = source.href;
source.href="#";
}
}
My javascript knows what link have been clicked with the "this"
reference.
My problem is that the program doesn't care whether you answer yes or
no : it just proceeds with the href reference after returning from my
function.
I thought of storing the href property in a temporary variable and
restore it later but this seems ugly to me (and not sure to make it
work either ).
And yes, I need a Hyperlink control
Many thanks for your help
I got a usercontrol which generates LinkButton objects. I want that
when the user click on it, a "confirm" javascript is generated.
After reading
http://groups.google.co.uk/group/mi...avascript+&qt_g=1&searchnow=Search+this+group
I did this :
deleteLink.Attributes["onclick"]="confirmCustom(this)";
in my aspx page, I got a function named confirmCustom :
function confirmCustom(source)
{
answer = confirm("are you sure ? ");
if (answer==false) {
temporaryHref = source.href;
source.href="#";
}
}
My javascript knows what link have been clicked with the "this"
reference.
My problem is that the program doesn't care whether you answer yes or
no : it just proceeds with the href reference after returning from my
function.
I thought of storing the href property in a temporary variable and
restore it later but this seems ugly to me (and not sure to make it
work either ).
And yes, I need a Hyperlink control
Many thanks for your help