<div style="height:500px">
<iframe style="height:100%;">I am 500px too!</iframe>
</div>
===============================
iframe1.Attributes.Add("style","width:50%;height:50%;");
=====================================================================
http://www.c-sharpcorner.com/Blogs/13005/form-posting-using-iframe-inside-a-web-user-control.aspx
function setIframeHeight() {
frame = parent.document.getElementById('frame1');
var sSupersetString = navigator.userAgent;
if (sSupersetString.indexOf("Firefox") != -1) {
$(frame).height($(frame).contents().find("html").height() + 3200);
}
else {
if (frame) {
var iframeWin = frame.contentWindow || frame.contentDocument.parentWindow;
if (iframeWin.document.body) {
frame.height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight;
frame.height =frame.height+ 3200;
innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
objToResize = (frame.style) ? frame.style : frame;
objToResize.height = (innerDoc.body.scrollHeight + 3200) + "px";
}
}
}
}
Sign up here with your email
ConversionConversion EmoticonEmoticon