I\'m trying to open a page in new tab/window on button click.I tried in the google got this code but its not working.
Can anybody help me with this?
Wouldn't you be better off with
Click here
Because, to replicate your desired behavior on an asp:Button, you have to call window.open on the OnClientClick event of the button which looks a lot less cleaner than the above solution. Plus asp:HyperLink is there to handle scenarios like this.
If you want to replicate this using an asp:Button, do this.
JavaScript function.
var windowObjectReference;
function openRequestedPopup() {
windowObjectReference = window.open("CMS_1.aspx",
"DescriptiveWindowName",
"menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes");
}