error in opening child window with window.open c# asp.net

843 Views Asked by At

I have a asp.net project and Im trying to link a button to new child window but I am getting this error message "content controls have to be top-level controls in a content page or a nested master page that references a master page."

aspx code;

    <a href="#" onClick="javascript:window.open('BelgeKayit.aspx','BelgeKayit','height=400,width=400'); return false;" target="_blank">
     <asp:ImageButton ID="imgBelgeEkle" runat="server" ImageUrl="~/images/BelgeEkle1.png"  PostBackUrl='<%#Eval("ID","~/Modul/BelgeKayit.aspx?Id={0}")%>' ToolTip="Belge Ekle" AlternateText="Belge Ekle" CommandArgument='<%#Eval("ID")%>' Width="25" Height="25" />
     </a>  
1

There are 1 best solutions below

7
On

try this

Remove return false

<a href="#" onClick="javascript:window.open('BelgeKayit.aspx','BelgeKayit','height=400,width=400');" target="_blank">