Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

sqldatasource dal, wwwxxxenden, convert raid5 to raid 10 mdadm, apache force chunked, nrao wwwxxx, xxxxxdup, procmail change subject header, wwwXxx not20, Wwwxxx.doks sas, linux raid resync after reboot

Links

XODOX
Impressum

#1: Opening a new window when button clicked

Posted on 2008-04-24 20:38:54 by Jim in Arizona

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:

<a href="../folder5/anotherpage.aspx" target=_blank>Another Page</a>

I've placed a button on the page that I would like to have do the same
thing:

<asp:button id="btnAnotherPageLink" runat="Server" text="Another Page" />

Protected Sub btnAnotherPageLink_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnActiveDialup.Click
Response.Redirect("../folder5/anotherpage.aspx")
End Sub

This will cause the current page to navigate to the destination page. How
can I have a new window open up and load the destination page instead?

TIA,
Jim

Report this message

#2: RE: Opening a new window when button clicked

Posted on 2008-04-24 21:13:00 by brucebarker

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)


"Jim in Arizona" wrote:

> 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:
>
> <a href="../folder5/anotherpage.aspx" target=_blank>Another Page</a>
>
> I've placed a button on the page that I would like to have do the same
> thing:
>
> <asp:button id="btnAnotherPageLink" runat="Server" text="Another Page" />
>
> Protected Sub btnAnotherPageLink_Click(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles btnActiveDialup.Click
> Response.Redirect("../folder5/anotherpage.aspx")
> End Sub
>
> This will cause the current page to navigate to the destination page. How
> can I have a new window open up and load the destination page instead?
>
> TIA,
> Jim
>
>
>

Report this message