【问题标题】:error in opening child window with window.open c# asp.netc#asp.net用window.open打开子窗口时出错
【发布时间】:2015-02-18 04:04:10
【问题描述】:

我有一个 asp.net 项目,我试图将按钮链接到新的子窗口,但我收到此错误消息“内容控件必须是内容页面中的顶级控件或引用母版页。”

aspx代码;

    <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>  

【问题讨论】:

    标签: c# asp.net href childwindow


    【解决方案1】:

    试试这个

    删除return false

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

    【讨论】:

    • 我已经尝试过了,当我这样做时,我也会丢失我希望它在打开子页面后运行的主页。
    • @amadeus 您可以使用 FireBug 进行调试
    • 我找不到任何东西,我使用了萤火虫,它看起来不错 @Ganesh_Devlekar
    • @amadeus 只需将其粘贴到您的浏览器中即可javascript:window.open('https://www.google.co.in','ganesh','height=400,width=400'); 这对我有用
    • 这也适用于我,也许问题在于我试图用 href 打开的 aspx 文件。但可能是什么问题? @Ganesh_Devlekar
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-01-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-04
    相关资源
    最近更新 更多