How to open Website url in Other than Iframe?

Posted by Mandlaa under HTML 5 on 10/23/2013 | Points: 10 | Views : 15469 | Status : [Member] | Replies : 4
<iframe id="ifrm1" runat ="server" src="http://dotnetfunda.com/"></iframe>
I am open the Website url using frame, this frame not display properly in Some devicess Like(Mobile ,Tablets)
Amy other way to display website urls other then Iframe




Responses

Posted by: Bandi on: 10/23/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
You can make an ajax call to fetch your html page and add it to the div. For example using JQuery:

$.get('yourPage.html', function(data) { $('#yourDiv').html(data); });


http://api.jquery.com/jQuery.get/

references:
http://forums.asp.net/t/1840455.aspx
http://stackoverflow.com/questions/8433319/embed-an-external-page-without-an-iframe
https://gist.github.com/aklump/5470863

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

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

Posted by: Mandlaa on: 10/23/2013 [Member] Starter | Points: 25

Up
0
Down
Actually i am doing this,
protected void Page_Load(object sender, EventArgs e)
{
String URL = http://www.aspforums.net/;


if (!String.IsNullOrEmpty(URL))
{

I1.Attributes["src"] = URL;
}
}
<body >
<form id="form1" runat="server">
<div class="auto-height">
<iframe id="I1" runat="server" name="I1" class="auto-height" frameborder="0">your browser does not support IFRAMEs</iframe>
</div>
</form>
</body>
Displaying correctly,But Mobile ,Tablets Not displying correctly.plz correct my code,

Alternative this iFrame What code i am using?
Edit my code what i am giving

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

Posted by: Bandi on: 10/23/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Refer this link once
http://www.onbile.com/info/html-frameset-scrolling-and-iframes-on-mobile-devices/

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

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

Posted by: Mandlaa on: 10/28/2013 [Member] Starter | Points: 25

Up
0
Down
<META NAME="Author" CONTENT="Guy Malachi">
<META NAME="Keywords" CONTENT="100% iframe resize javascript one hundred percent ">
<META NAME="Description" CONTENT="">
<script language="JavaScript">
<!--

function resize_iframe() {
document.getElementById("info").innerHTML = 'iframe offsetTop: <b> ' + document.getElementById("glu").offsetTop + "</b><br>body.offsetHeight:<b>" + document.body.offsetHeight + "</b>";//display some information on the screen

var height = window.innerWidth;//Firefox
if (document.body.clientHeight) {
height = document.body.clientHeight;//IE
}

document.getElementById("glu").style.height = parseInt(height - document.getElementById("glu").offsetTop - 8) + "px";//resize the iframe according to the size of the window
//document.getElementById("glu").height=document.body.offsetHeight-document.getElementById("glu").offsetTop-26;
}

/*
//Here is another way to define the function (this function reloads the page whenever the user resizes the page)
window.onresize=
function (e)
{
location.reload();
};
*/

window.onresize = resize_iframe; //instead of using this you can use: <BODY onresize="resize_iframe()">
//-->
</script>

</HEAD>

<BODY>
<span id=info>
</span>
<iframe id='glu' src="http://notous.azurewebsites.net/Hondaofconyers/Newcars/1" width=100% onload='resize_iframe()'></iframe>
</BODY>
</HTML>



This code is working for me in HTML page
I am putting this one in ASPX page getting an error like this

ERROR:Compiler Error Message: CS1061: 'ASP.webform13_aspx' does not contain a definition for 'resize_iframe' and no extension method 'resize_iframe' accepting a first argument of type 'ASP.webform13_aspx' could be found (are you missing a using directive or an assembly reference?
What is the mistake for this one??

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm13.aspx.cs" Inherits="WebRole1.WebForm13" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<TITLE>Iframe with 100% height - atguy.com</TITLE>
<META NAME="Author" CONTENT="Guy Malachi">
<META NAME="Keywords" CONTENT="100% iframe resize javascript one hundred percent ">
<META NAME="Description" CONTENT="">
<script language="JavaScript">
<!--

function resize_iframe() {
document.getElementById("info").innerHTML = 'iframe offsetTop: <b> ' + document.getElementById("glu").offsetTop + "</b><br>body.offsetHeight:<b>" + document.body.offsetHeight + "</b>";//display some information on the screen

var height = window.innerWidth;//Firefox
if (document.body.clientHeight) {
height = document.body.clientHeight;//IE
}

document.getElementById("glu").style.height = parseInt(height - document.getElementById("glu").offsetTop - 8) + "px";//resize the iframe according to the size of the window
//document.getElementById("glu").height=document.body.offsetHeight-document.getElementById("glu").offsetTop-26;
}

/*
//Here is another way to define the function (this function reloads the page whenever the user resizes the page)
window.onresize=
function (e)
{
location.reload();
};
*/

window.onresize = resize_iframe; //instead of using this you can use: <BODY onresize="resize_iframe()">
//-->
</script>

</head>
<body>
<form id="form1" runat="server">
<div>
<span id=info>
</span>
<iframe id='glu' runat="server" src="http://notous.azurewebsites.net/Hondaofconyers/Newcars/1" width=100% onload='resize_iframe()'></iframe>
</div>
</form>
</body>
</html>


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

Login to post response