Are you putting return false in your javascript or in the click event? Try
it this way?
Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
Button1.Attributes.Add("onclick", _
"doWelcome(); return false;")
End Sub
If this isn't the issue, maybe you could post the code that isn't working
and we can try again?
Ken
MVP [ASP.NET]
[quoted text, click to view] "jbhopper" <anonymous@discussions.microsoft.com> wrote in message
news:0B019A26-0F54-470B-A1EB-3D6ABA6193AA@microsoft.com...
>I use Attribute.Add to call a javascript function client-side from an
>asp:button control. The javascript function opens a window. My problem is
>that the submit event fires after the javascript code executes. When I view
>the source in "running documents" I see that the button is declared as
>"type=submit", even when I provide a commandName, which I thought changed a
>submit button into a command button. When I try to return false from the
>javascript function I get "return type mismatch". I've used this method
>successfully in user controls, but now I can't use it in a web page. Any
>suggestions?
>
> Thanks!