buttons do a form submit. you set the target on the form to control this.
asp.net forms do not allow the target to be set, so yo must use a non-server
form, or use javascript to set the target.
-- bruce (sqlwork.com)
> When placing a link using html, it's easy to have a new window opened for
> the link instead of redirecting the current page to the destination. IE:
[quoted text clipped - 16 lines]
> TIA,
> Jim
Jim in Arizona - 24 Apr 2008 23:14 GMT
> buttons do a form submit. you set the target on the form to control this.
> asp.net forms do not allow the target to be set, so yo must use a
> non-server
> form, or use javascript to set the target.
>
> -- bruce (sqlwork.com)
After some searching, I found that adding this to the Page_Load sub did the
trick:
btnAnotherPageLink.Attributes.Add("onClick",
"window.open('../folder5/anotherpage.aspx')")
Mark Rae [MVP] - 24 Apr 2008 23:28 GMT
> After some searching, I found that adding this to the Page_Load sub did
> the trick:
>
> btnAnotherPageLink.Attributes.Add("onClick",
> "window.open('../folder5/anotherpage.aspx')")
Or alternatively:
<asp:Button ID="btnAnotherPageLink" runat="server" Text="Another Page"
OnClientClick="window.open('../folder5/anotherpage.aspx');return false;" />
Don't forget the semi-colons at the end of each JavaScript statement...

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
Jim in Arizona - 24 Apr 2008 23:43 GMT
>> After some searching, I found that adding this to the Page_Load sub did
>> the trick:
[quoted text clipped - 9 lines]
>
> Don't forget the semi-colons at the end of each JavaScript statement...
Oh! That's helpful! Thanks Mark!
Mark Rae [MVP] - 25 Apr 2008 00:26 GMT
> Oh! That's helpful! Thanks Mark!
Always a pleasure, never a chore... :-)

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net