is it possible to have a target=\"_blank\"
in LinkButton
...mine doesnt seem to be working
Just render an anchor with href set to appropriate url and set the target
attribute to _blank
it will open the url into new window.
<a href="urlOfThePage" target="_blank" >Click me</a>
After looking at these answers and none was exactly what I wanted (do this with a button look), I ended up using a hyperlink control, but used the same css style as my regular buttons:
.button {
background-color:#011745;
color:white;
padding:7px 12px 7px 12px;
margin:3px;
border-style:none;
font-size:12px;
}
.button:hover {
background-color:#336699;
color:white;
padding:7px 12px 7px 12px;
margin:3px;
border-style:none;
font-size:12px;
}
It looked just like them! If you are going for a button that opens a link in a new window, which I was, it was almost perfect. In a set of table cells, it displayed just a touch lower than the regular buttons, so I styled it like this: "position:relative; top:-2px;" and that did the trick. I also had to force the forecolor white:
<asp:HyperLink ID="btnSummaryReport" Target="_blank" runat="server" Text="SUMMARY REPORT" CssClass="button" ForeColor="white" Font-Size="8" style="position:relative; top:-2px" />