Microsoft Knowledge Base Email Alertz

(830737) - You may create an HTML page in Microsoft Visual Studio .NET by using Visual C# .NET, and then add an iframe element with the src attribute with the value of http://www.ValidURL.com , where http://www.ValidURL.com is the URL of a valid Web site. When...

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 830737 - Last Review: May 17, 2007 - Revision: 2.4

PRB: iframe Object Source Is Cached in the Design View of an HTML Page in Visual C# .NET

On This Page

SYMPTOMS

You may create an HTML page in Microsoft Visual Studio .NET by using Visual C# .NET, and then add an iframe element with the src attribute with the value of http://www.ValidURL.com, where http://www.ValidURL.com is the URL of a valid Web site. When you change the value of the src attribute to the name of the container page (the name of the HTML page itself), and then switch to Design view, you may notice the cached content in the iframe object.

Note You may notice the same behavior when you delete an HTML page that has an iframe element, and then create another HTML page that has an iframe element.

WORKAROUND

To work around this problem, refresh the HTML page in the Design view.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce the Behavior

Microsoft Visual Studio .NET caches the source for an iframe object in the Design view of an HTML page in either of the following scenarios.

When You Modify the Value of the src Attribute in an HTML Page

  1. Start Visual Studio .NET.
  2. Use Microsoft Visual C# .NET to create an ASP.NET Web Application project that is named Iframetest.
  3. In Solution Explorer, right-click Iframetest, point to Add, and then click Add HTML Page.
  4. In the Add New Item - Iframetest dialog box, click Open. By default, the HTMLPage1.htm page is created.
  5. Right-click in the Design view of the HTMLPage1.htm page, and then click View HTML Source.
  6. Replace the existing code with the following code to add an iframe element to the HTMLPage1.htm page:
    <html>
    	<head>
    		<title>HTMLPage1</title>
    	</head>
    	<body MS_POSITIONING="GridLayout">
    		<iframe id="iframe1" src="http://www.ValidURL.com"></iframe>
    	</body>
    </html>
    
  7. On the File menu, click Save HTMLPage1.htm.
  8. Right-click in the HTML view of the HTMLPage1.htm page, and then click View Design. You may notice that the http://www.ValidURL.com Web page is displayed in the iframe object.
  9. Switch to HTML view, and then modify the value of the src attribute of the iframe element as follows:
    <iframe id="iframe1" src="HTMLPage1.htm"></iframe>
    
  10. On the File menu, click Save HTMLPage1.htm.
  11. Right-click in the HTML view of the HTMLPage1.htm page, and then click View Design.

    You may notice that the http://www.ValidURL.com Web page is displayed in the iframe object, instead of a blank page.

When You Delete and Then Create an HTML Page

  1. Follow steps 1 to 9 of the "When You Modify the Value of the src Attribute in an HTML Page" section of this article to create an ASP.NET Web Application project that has an HTML page that contains an iframe element.
  2. In Solution Explorer, right-click HTMLPage1.htm, and then click Delete.
  3. Right-click Iframetest, point to Add, and then click Add HTML Page.
  4. In the Add New Item - Iframetest dialog box, click Open. By default, the HTMLPage1.htm page is created.
  5. Right-click in the Design view of the HTMLPage1.htm page, and then click View HTML Source.
  6. Replace the existing code with the following code to add an iframe element to the HTMLPage1.htm page:
    <html>
    	<head>
    		<title>HTMLPage1</title>
    	</head>
    	<body MS_POSITIONING="GridLayout">
    		<iframe id="iframe1" src="HTMLPage1.htm"></iframe>
    	</body>
    </html>
  7. On the File menu, click Save HTMLPage1.htm.
  8. Right-click in the HTML view of the HTMLPage1.htm page, and then click View Design.

    You may notice that the http://www.msn.com Web page is displayed in the iframe object, instead of a blank page.

REFERENCES

For more information about iframe, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/library/ms535258.aspx (http://msdn2.microsoft.com/en-us/library/ms535258.aspx)

APPLIES TO
  • Microsoft Visual C# .NET 2003 Standard Edition
  • Microsoft ASP.NET 1.1
Keywords: 
kbwebbrowser kbcontrol kbcaching kbhtml kbprb KB830737
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate