Click here to Skip to main content
14,084,762 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
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>
Posted
Updated 2 days ago
Comments
Krunal Rohit 19-Feb-14 11:04am
   
Can you paste the exact error here ?
-KR
S.Rajendran from Coimbatore 19-Feb-14 11:45am
   
I also tried like this but no use:
<iframe src="~/good food logo.jpg" runat="server" ></iframe>
S.Rajendran from Coimbatore 19-Feb-14 11:12am
   
Actually there is no error..but instead of that image "~foog food logo.jpg" , i get a different display like 'Server error in 'website1'/application ..the resource cannot be..' at that position. That' all.
   
I guess the path is wrong.
joginder-banger 19-Feb-14 15:06pm
   
../googfoodlogo.jpg
S.Rajendran from Coimbatore 19-Feb-14 22:27pm
   
Yeah i changed and tried. Same problem exists.
ZurdoDev 19-Feb-14 22:28pm
   
iframe is a regular html element so you cannot use the ~ for path. Use / instead.
S.Rajendran from Coimbatore 20-Feb-14 3:17am
   
Thanks, it works.
ZurdoDev 20-Feb-14 7:04am
   
Glad to hear. I'll post as solution.

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

The ~ does not work on iframes because it is not a .Net control but rather a standard HTML control. Instead you should use /.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web03 | 2.8.190518.1 | Last Updated 16 May 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100