Are you talking about an actual server-side onClick event handler in
ASP.NET?
Your code is running client-side, instead of using JavaScript, you are using
VBScript, but it's still client-side (running in the browser). A server
side method can't call a client-side one.
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
<rlrcstr@newsgroups.nospam> wrote in message
news:OfEJ$WVFGHA.3944@tk2msftngp13.phx.gbl...[color=blue]
> Looking to do something pretty simple... I have a cancel button on my
> page.
> When the user clicks it, i want to verify they want to cancel and if so,
> redirect them.
>
> Code:
> -------------------------------------------------------------
> <html>
> <script language=vbscript>
> if MsgBox("Testing",4) = 6 Then
> window.location = "http://www.google.com"
> End if
> </script>
> </html>
> --------------------------------------------------------------
>
> This code works just fine like that, but when I place it in a sub
> procedure
> and call it in response to an onclick event, the redirect never happens.
> I
> even placed an alert box in the if block ot verify that I was getting into
> the block. I got the alert, but no redirect. Why doesn't this work in
> repsonse to an onclick event, but it deos work by itself in a separate
> page?
> Thanks.
>
> Jerry
>
>
>
>
>
>
>
>
>[/color]