Problem with doing this sort of client side rerouting is that.. sometimes
the client has script accessed turned off, using a low level browser, etc.
etc. all sorts of problems. Therefore I decided to just make a simple server
sideded dialog box.... STILL an ugly hack though. =P
"Martin" <an****@mail2world.com> wrote in message
news:40***********************@news.wanadoo.nl...
If the button is called btn1, add the following code to the Page_load: (in
vb)
Dim btn as button = btn1
btn.Attributes.Add("onClick")="javascript: return etc. ...."
The code in the onclick event of the button will only fire when the
javascript returns TRUE.
"Michael Ramey" <raterus@localhost> schreef in bericht
news:Ov**************@TK2MSFTNGP10.phx.gbl... You can do this from code to the button, i'm not quite sure yet how you
can set onClick attributes to a web control from the designer.
Button1.Attributes.Add("onClick", "javascript:return confirm('are you
sure');")
"dwa" <da@hotmail.com> wrote in message
news:O$**************@TK2MSFTNGP09.phx.gbl... When we want to confirm a user action before a post back occurs,
we've been writing code like this:
function onClickDelete()
{
var aResponse = window.confirm("Delete this record?");
if ( aResponse )
__doPostBack('theLayout$_ctl1$buttonDelete','') ;
return 0;
}
This seems like an "un-natural" act - is there a better way?
-- dwa