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?
<asp:Button ID="btn" runat="Server" Text="SUBMIT"
OnClick="btnNewEntry_Click" OnClientClick="aspnetForm.target ='_blank';"/>
protected void btnNewEntry_Click(object sender, EventArgs e)
{
Response.Redirect("CMS_1.aspx");
}
When I use this I'm getting error saying
Microsoft JScript runtime error: 'aspnetForm' is undefined.
You can do something like this :
<asp:Button ID="Button1" runat="server" Text="Button"
onclick="Button1_Click" OnClientClick="document.forms[0].target = '_blank';" />