Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
if you have any idea how to add a frame that displays another page in a default page using ASP.NET please tell me because i tried too much and i wouldn't work with me. it says Element 'frameset' is not supported...
Posted

1 solution

try this

XML
<div  id="ifrm" >
      <iframe name="ttframe"
              id="ttframe"
              src="Put your source here"
              scrolling="no"
              marginwidth="0"
              marginheight="0"
              frameborder="0"
              width=100%
              height=0
              style="position:relative; left:0px; top:0px;">
      </iframe>
    </div>


One of the issues with iframe is that you can not set a height in terms of percentage. So, either you need to try it set it in css ( I am not sure if that is possible ) or you need to adjust it using JavaScript as shown.


C#
// JScript File
$(function () {
    if ($.browser.safari || $.browser.opera) {
        // Start timer when loaded.
        $("#ttframe").load(function () {
            setTimeout(resizeAllIFrames, 0);
        }
        );
    }
    else {
        resizeIFrame();
        $("#ttframe").load(resizeIFrame);
    }
});
function resizeIFrame() {
    if ($.browser.safari || $.browser.opera) {
    }
    else {
        var ttfrm = $("#ttframe");
        var innerDoc = (ttfrm.get(0).contentDocument) ?
                    ttfrm.get(0).contentDocument :
                    ttfrm.get(0).contentWindow.document;
        ttfrm.height(innerDoc.body.scrollHeight + 35);
    }
    location.href = "#";
}
// Resize heights.
function resizeAllIFrames() {
    var ttfrm = $("#ttframe");
    var innerDoc = (ttfrm.get(0).contentDocument) ?
                    ttfrm.get(0).contentDocument :
                    ttfrm.get(0).contentWindow.document;
    ttfrm.height(innerDoc.body.scrollHeight + 35);
    location.href = "#";
}
 
Share this answer
 
Comments
Albin Abel 13-Feb-11 8:26am    
my 5
Ali Al Omairi(Abu AlHassan) 13-Feb-11 19:18pm    
..and, have mine.
shadi_abushaar 14-Feb-11 1:04am    
thank you so much...

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