Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hello friends,
I'm trying to migrate the asp.net application from 1.0 to 4.0.
Problem I faced, Use of frame

<html>
  <head>
    <title>Project Estimation</title>
    <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
    <meta name="CODE_LANGUAGE" Content="C#">
    <meta name=vs_defaultClientScript content="JavaScript">
    <meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
    <LINK href="Formatting\RevRec_stylesheet.css" type="text/css" rel="stylesheet">
	<script language="javascript" src="JavaScript/CommonJSFunctions.js"></script>
  </head>
  <frameset rows="44%,3.5%,*" border="0" frameSpacing="0" frameBorder="0"  önload="enableTabs();window.moveTo(0,0);window.resizeTo(screen.availWidth, screen.availHeight);">
		<frame id="frmrevrec" src="wf_ProjectEstimates.aspx" name="frmcnf" marginwidth="0" marginheight="0"
			scrolling="no" frameborder="no">
		<frame id="tabs" src="wf_PrjEstMenu.aspx" name="tabs" marginwidth="0" marginheight="0" scrolling="auto"
			frameborder="no" noresize>
		<frame id="tabsobj" src="" name="tabsobj" marginwidth="0" marginheight="0" scrolling="auto"
			frameborder="no" bordercolor="black" noresize>
	</frameset>
</html>


I change the code to master and child page as below
<asp:Content ID="Content1" ContentPlaceHolderID="cphPage" runat="server">
      <asp:UpdatePanel ID="pnlUpdateMessage" runat="server" UpdateMode="Conditional">
        <contenttemplate>
            <table id="tblMessage" style="width: 100%">
                <tr>
                    <td>
                        <uc:ucmessage_ascx ID="ucMessage"  runat="server" />
                    </td>
                </tr>
            </table>
        </contenttemplate>
    </asp:UpdatePanel>
    <div>
        <frameset rows="44%,3,*" border="0" frameSpacing="0" frameBorder="0" 
               önload="enableTabs();window.moveTo(0,0);window.resizeTo(screen.availWidth, screen.availHeight);">
		    <frame id="frmrevrec" src="wf_ProjectEstimates.aspx" name="frmcnf" marginwidth="0" marginheight="0"
			    scrolling="no" frameborder="no">
		    <frame id="tabs" src="wf_PrjEstMenu.aspx" name="tabs" marginwidth="0" marginheight="0" scrolling="auto"
			    frameborder="no" noresize>
		    <frame id="tabsobj" src="" name="tabsobj" marginwidth="0" marginheight="0" scrolling="auto"
			    frameborder="no" bordercolor="black" noresize>
	    </frameset>
    </div>
</asp:Content>


Problem is that the pages in the frame are not displayed.
Any idea how to overcome??
should i need to use IFrame or is thr any better option available??

thanks in advance
Posted
Comments
cpsglauco 7-Sep-12 5:42am    
Is This code in master page or webForm?
Karthik. A 7-Sep-12 12:15pm    
From the sample it looks like this is a content page - ContentPlaceHolderID etc are used

1 solution

Using frmaeset / frame etc is not recommended. Why don't you just use a bunch of div's w/ pseudo frames ? Check out the following plugin :

jquery layout - http://layout.jquery-dev.net/demos.cfm[^]

and here is an example:

http://layout.jquery-dev.net/demos/simple.html[^]

To load the data in each section, you can use $.load (http://api.jquery.com/load-event/[^]).

So, in a high level, this is what you have to do.

First define the html:

HTML
<div>
   <div id="section1">
   </div>

   <div id="section2">
   </div>


   <div id="section3">
   </div>
</div>


Then use jquery to load

JavaScript
$(function(){
   $('#section1').load('page1.aspx');
   $('#section2').load('page2.aspx');
   $('#section3').load('page3.aspx');
});


Finally apply the layout plugin to give the appearance of having frames.

PS - This is just an alternate approach and not a solution to your problem.

Sorry, if I missed something or unclear. Do post your comments.

Hope this helps!
 
Share this answer
 
v2
Comments
dhage.prashant01 9-Sep-12 23:22pm    
I appreciate your work friend
But i don't want to change the entire code, actually this page has 3 frames which in turn call three different pages.
I tried with actual code, but it seems .NET 4.0 don't support frames.
So was thinking to work around with frames.

Any more suggestion??
Karthik. A 10-Sep-12 9:43am    
Can you elaborate on ".NET 4.0 don't support frames" ? .Net 4.0 does not stop you from using frames as its up to the browser to understand that you are using frames and display them. There is also a tag called <noframes /> that you can use to indicate to users that their browser does not support, which they wont see if their browser supports using frames. In the current age it is not just recommended. Are you getting any script errors or code errors ?
dhage.prashant01 4-Oct-12 2:50am    
Actually the frames are not visible when I run an application
Karthik. A 4-Oct-12 12:24pm    
Did you try inspecting the code? Do you see the iframe tags in it ? Also use fiddler and see if there are requests for the page you load in your iframe. The url might be wrong or may not be returning any data. I guess fiddler will be of great help to you.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900