I have a problem on dynamic iframe

Posted by Sksamantaray under ASP.NET on 3/17/2012 | Points: 10 | Views : 1310 | Status : [Member] | Replies : 4
How can i dynamically handle the height of iframe.
Description:
suppose there are 2 Link buttons .
Linkbutton1 pouplate site-1 whose contents require lets say 500px(but not sure)
Linkbutton1 pouplate site-2 whose contents require lets say1 500px(but not sure)

we can not provide fixed height to iframe , because we never know how much height the output requires.?

Thanks,
Sanjay



Responses

Posted by: Sabarimahesh on: 3/19/2012 [Member] Bronze | Points: 25

Up
0
Down
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Main.aspx.cs" Inherits="_Default" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
#frame1
{
width: 908px;
height: 766px;
top: 62px;
left: 163px;
position: absolute;
}
#I1
{
top: 59px;
left: 166px;
position: absolute;
height: 770px;
width: 907px;
}
</style>
</head>

<body background="light-grey-stippled.jpg">
<form id="form1" runat="server">
<div>
<iframe id="I1" name="I1"></iframe>

</div>
<div style="width: 1072px; top: 6px; left: 0px; position: absolute; height: 52px;background-image:url(yellow-beauty-plain-spectrum-backgrounds-wallpapers.jpg)">
<div style="top: 27px; left: 670px; position: absolute; height: 23px; width: 401px">
&nbsp;&nbsp;&nbsp;
<a href="LoginPage.aspx" target="I1" style="color:#663300;font-size:large">Home</a>
&nbsp;&nbsp;&nbsp;
<a href="LoginPage.aspx" target="I1" style="color:#663300;font-size:large">Service</a>
&nbsp;&nbsp;
<a href="LoginPage.aspx" target="I1" style="color:Yellow;font-size:large">Contact us</a>
&nbsp;
<a href="LoginPage.aspx" target="I1" style="color:ThreeDFace;font-size:large" >Login</a>
</div>
</div>
<div style="top: 62px; left: 0px; position: absolute; height: 767px; width: 163px;background-image:url(yellow-beauty-plain-spectrum-backgrounds-wallpapers.jpg)">
</div>
</form>
</body>
</html>




See this Carefully...
a tag shows that link to one button
target "I1"=you want to mention in frame script


Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

Sksamantaray, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 3/19/2012 [Member] Silver | Points: 25

Up
0
Down
Hi,
You have used target "I1" but it has some fixed height in CSS.
Suppose you mention some external link in that hyperlink say "http://scalable-systems.com", you never know how much height it requires for the first page.Lets say it requires 200px but you you have mentioned 770px. So there will be some white space.


Thanks,
Sanjay

Sksamantaray, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 3/19/2012 [Member] Silver | Points: 25

Up
0
Down
Moreover my Requirement is related to iframe which is created dynamically (Codebehind).
How to handle the height of the frame depending upon the height of passed url page?


Thanks,
Sanjay

Sksamantaray, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sabarimahesh on: 3/19/2012 [Member] Bronze | Points: 25

Up
0
Down
Sksamantaray

You are Right ...

But now i Don't Know ..

I will Post You Soon

Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

Sksamantaray, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response