The Button control is rendered as <input type="submit"> by default, so
clicking the button will make a post, I would suggest you to to either use
Ajax to make the post "invisible" or you can add a Button and set the
OnClientClick to something like "window.open('page.aspx'); return false;",
this will popup a new window where page.aspx would call your sub and close
itself.
have a look at
http://msdn.microsoft.com/library/de...ods/open_0.asp
if you want to make change the properties of the popup window. Remember that
some popup blockers may stops this popup from opening.
Bruno
<> wrote in message
news: oups.com...
> Hi,
>
> I want a button that just calls a subroutine (rather than submitting a
> form). So, I have done this:
>
> <asp:Button id="btNewNetworkProvider" text="New"
> commandname="newprovider" onclick="newprovider" runat="server"/>
>
> and:
>
> Sub newprovider(sender As Object, e As EventArgs)
> ...
> End Sub
>
> However when I press the button it just submits the form. There is
> already another button that does the submit and I have tried setting:
>
> <form id="Form1" defaultbutton="btSubmit" ..
>
> but this has changed nothing.
>
> Regards,
>
> Paul
>