简体   繁体   English

外部加载 <Div></Div> 到iframe

[英]Loading external <Div></Div> to Iframe

In my project am using a master page named as master.aspx in particular page i need to include another page into the current page, so that i use <iframe> to achieve this. 在我的项目中,正在使用一个名为master.aspx的母版页面,在特定页面中,我需要在当前页面中包含另一个页面,以便使用<iframe>来实现这一目的。 while passing the url to the iframe the master page will also load inside the <iframe> how can i avoid such loading of master page inside the iframe? 在将url传递到iframe ,母版页也将加载到<iframe>内,如何避免在iframe内加载母版页?

i can't avoid master page in the page which i called, is it possible to call particular <Div> or <content template> in iframe? 我无法避开我调用的页面中的母版页,是否可以在iframe中调用特定的<Div><content template>

seems you are using asp.net, maybe you can try to edit the first row in .aspx page, try to add the following code to the page which you don't want to show the master page. 似乎您正在使用asp.net,也许您可​​以尝试编辑.aspx页的第一行,并尝试将以下代码添加到您不想显示母版页的页面中。

Theme="" StyleSheetTheme="" 主题=“” StyleSheetTheme =“”

==== Update ==== ==== 更新 ====

if you want to hide it in iframe only, you should pass a parameter in url like ?theme=none 如果您只想将其隐藏在iframe中,则应在url中传递一个参数,如?theme = none

then handle it in the Page_load Function in .aspx.cs as follow: 然后在.aspx.cs中的Page_load函数中对其进行处理,如下所示:

protected void Page_Load(object sender, EventArgs e) 
{
 if(Request["theme"] == "none"){
  Page.Theme = "";
  Page.StyleSheetTheme = "";
 }
}

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM