如何使用iframe作为母版页? [英] how to use iframe for master page?
本文介绍了如何使用iframe作为母版页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的项目(website1)中我有母版页和内容页面。每当我单击母版页中的菜单时,母版页都会刷新。我学到了一些关于刷新母版页问题的知识。因此,我尝试使用以下代码使用'iframe'。它工作没有刷新,但
显示像'网站1'中的服务器错误'/应用程序..资源不能......在那个位置。任何人都可以指导我如何使用iframe作为徽标'〜/ good foof logo.jpg'。
in my project (website1) i have master page and content page. Whenever i click the menu in master page, the master page is refreshing. I learnt something about refreshing of master page problem. As a result I tried with 'iframe' with the following code. it works without refreshing but with
a display like 'Server error in 'website1'/application ..the resource cannot be..' at that position. Can anyone guide me on how to use iframe for the logo '"~/good foof logo.jpg"'.
<asp:Panel ID="Panel1" runat="server" Width="943" Style=" margin-left:285px; margin-top:2px;" Height="200" >
<table class="" style=" margin-left:-1px; margin-top:-1px" width="178">
<tr>
<td>
<iframe src="~/good foof logo.jpg" ></iframe>
<%--<asp:Image ID="Image3" runat="server" DescriptionUrl="~/good food logo.jpg"
Height="200px" ImageUrl="~/good food logo.jpg" Width="220px" />--%>
</td>
</tr>
</table>
推荐答案
〜不适用于iframe,因为它不是.Net控件,而是标准的HTML控件。相反,你应该使用/.
The ~ does not work on iframes because it is not a .Net control but rather a standard HTML control. Instead you should use /.
这篇关于如何使用iframe作为母版页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文