Juri Bogdanov
Juri Bogdanov

Reputation: 295

C# LinkButton.PostBackUrl - New window without JS

Is it possible to use asp:LinkButton without JavaScript to open new windows? Currently i have workable next code, but with JS.

<asp:LinkButton ID="lnkPcName" runat="server" OnClientClick="window.document.forms[0].target='_blank';" PostBackUrl='<%# Eval("ComputerId", "ComputerInfo.aspx?ComputerId={0}") %>'><%# Eval("pcName") %></asp:LinkButton>

Upvotes: 3

Views: 25894

Answers (1)

Issa Qandil
Issa Qandil

Reputation: 1238

As i know linkbuttons were originally designed to do a postback to the same page

If i were you i would use a hyperlink control instead

Upvotes: 13

Related Questions