C# 正在打开iframe标记内的URL,目标为父对象
问题:如何从iframe标记中打开URLC# 正在打开iframe标记内的URL,目标为父对象,c#,asp.net,iframe,response.redirect,C#,Asp.net,Iframe,Response.redirect,问题:如何从iframe标记中打开URL <iframe name="iCartInfo" id="Iframe1" runat="server" src="https://www.mysite.domain/shop/cart/MyShoppingCartLine.aspx" scrolling="no" seamless="seamless" style="float: right; border: none; overflow-y: hidden;" width="380" heig
<iframe name="iCartInfo" id="Iframe1" runat="server" src="https://www.mysite.domain/shop/cart/MyShoppingCartLine.aspx" scrolling="no" seamless="seamless" style="float: right; border: none; overflow-y: hidden;" width="380" height="40"></iframe>
我有一个asp.net web应用程序,其中包括一个位于子文件夹中的购物车,不过出于测试目的,完全需要另一个URL
我使用iframe标记将购物车的一部分包含在主站点上
<iframe name="iCartInfo" id="Iframe1" runat="server" src="https://www.mysite.domain/shop/cart/MyShoppingCartLine.aspx" scrolling="no" seamless="seamless" style="float: right; border: none; overflow-y: hidden;" width="380" height="40"></iframe>
我将其从相对URL更改为绝对URL,以查看当在iframe页面的头部包含base标记时,这是否解决了问题,但是没有,当我单击时不会发生任何事情。我能看到的最接近的情况是其他页面或代码受到某种方式的影响
有没有其他方法可以不打乱iframe中的代码,让请求在父级浏览器窗口中打开,而不是在iframe中打开?您能澄清一下情况吗?在IFRAME内部,有东西重定向到whatever.aspx,您希望该页面在父级而不是IFRAME中打开,并且不接触MyShoppingCartLine.aspx的代码?或者触摸IFRAME内的代码是一个选项?
Response.Redirect("~/whatever.aspx");