A
Alphonse Giambrone
Thanks to info from Steven Cheng I am able to use an HTML button on my aspx
page in order to wrap text in it.
I am using it to delete a record in a database and it works.
My only problem is that I want to include javascript to confirm the deletion
before submitting.
I have a javascript function that prompt for confirmation and returns
true/false.
For a regular server side button I add it as follows in the page load event
and it works fine:
btnDelete.Attributes.Add("onclick", "return ConfirmDelete();")
However if I add it the same way to the HTML button, the prompt works, but
the page is not submitted.
Looking at the source, this is what is rendered for the event with and
without my added function:
onclick="return ConfirmDelete(); {if (typeof(Page_ClientValidate) !=
'function' || Page_ClientValidate())
__doPostBack('U_PageLinks1$btnDelete','')} "
onclick="{if (typeof(Page_ClientValidate) != 'function' ||
Page_ClientValidate()) __doPostBack('U_PageLinks1$btnDelete','')} "
Any suggestion on how I can confirm the delete and still submit the page?
TIA
page in order to wrap text in it.
I am using it to delete a record in a database and it works.
My only problem is that I want to include javascript to confirm the deletion
before submitting.
I have a javascript function that prompt for confirmation and returns
true/false.
For a regular server side button I add it as follows in the page load event
and it works fine:
btnDelete.Attributes.Add("onclick", "return ConfirmDelete();")
However if I add it the same way to the HTML button, the prompt works, but
the page is not submitted.
Looking at the source, this is what is rendered for the event with and
without my added function:
onclick="return ConfirmDelete(); {if (typeof(Page_ClientValidate) !=
'function' || Page_ClientValidate())
__doPostBack('U_PageLinks1$btnDelete','')} "
onclick="{if (typeof(Page_ClientValidate) != 'function' ||
Page_ClientValidate()) __doPostBack('U_PageLinks1$btnDelete','')} "
Any suggestion on how I can confirm the delete and still submit the page?
TIA