简体   繁体   English

使用window.open c#asp.net打开子窗口时出错

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

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

aspx code; 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>  

try this 尝试这个

Remove return false 删除return false

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ASP.net C#避免两次打开同一窗口 - ASP.net c# Avoid open the same window twice 使用window.open从C#的代码背后打开一个新窗口 - Open a new window from codebehind C# with window.open ASP.NET-Window.Open(URL)-缓存了文件,如何停止它? - ASP.NET - Window.Open(URL) - File is cached, how do I stop it? Window.open 脚本管理器正在打开 2 页 - Window.open script manager is opening 2 pages asp.net:如何使用c#在新窗口(不是标签页或当前页面)中打开新的asp.net页 - asp.net: How to open a new asp.net page in new window (not tab or current page) using c# 打开一个新的窗口 Codebehind ASP.net - Opening a new Window Codebehind ASP.net 是否可以在不使用 asp.net C# 中的 jquery 的情况下在按钮单击事件中打开弹出窗口? - Is it possible to open popup window in button click event without using jquery in asp.net C#? 使用 ASP.NET 按钮、C# 和页面背后的代码在新选项卡中打开窗口 - Open Window in new tab using an ASP.NET Button, C#, and the code behind the page 如何显示图像的缩略图并单击该链接,它应在asp.net c#的窗口中打开以供查看 - how to display thumbnail of image & clicking on that link it should open in window for view in asp.net c# 如何在新选项卡或窗口中打开PDF文件,而不是使用C#和ASP.NET MVC下载它? - How to open PDF file in a new tab or window instead of downloading it using C# and ASP.NET MVC?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM