I just found this post on the asp.net mokeefe forums, which changes the target using javascript.
I just put it on my page and tried it. I had to make the following changes:
1. I use only asp tags, so I have <asp:Button> not <input type="button"> , and my onclick should be a server-side method I'm calling for a view. So I put this new javascript in OnClientClick :
<asp:Button ID="cmdEmailSearch" runat="server" Text="Search" OnClick="cmdEmailSearch_Click" OnClientClick="javascript:pageSubmit()"/>
2. I deleted myForm.submit () since ASP.NET renders the page by placing WebForm_DoPostBackWithOptions () javascript in the onclick button right after it places my Submit () page
<script type="text/javascript"> function pageSubmit(){ </script>
source share