Iframe extra space

M

Mike

All:
I am a newbee to ASP.NET
I have created an aspx webpage for the title bar which I want to use in
other pages in the website.When I use an iframe in webpages to use the
title bar, I get an unknown white space after the titlebar followed by
the regular pages. I use the following syntax in regular webpages to
display the titlebar.

<iframe src="titlebar.aspx" style="width: 100%; height:100%;
margin-bottom:0" frameborder="0" marginheight="0" marginwidth="0"
scrolling="no"></iframe>

Can anyone point out why it is happening?

Please suggest me an alternative code to embed an aspx page into
another one.

Thanx in advance.
 
M

Mike

I see that the following code is created after IFrame:

<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwUJNzgzNDMwNTMzZGSx14spmB/6CqhxtWIl52fa9pfc2w==" />
</div>

Any clues now?
 
R

Rob

Mike,

You should be looking into Master Pages.... these will really solve your
header problems.

Here's a sample header page:

<%@ Master Language="C#" AutoEventWireup="true"
CodeFile="SubPages.master.cs" Inherits="MainMenu" %>
<!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>
<link rel="stylesheet" type="text/css" href="~/Styles.css" />
<script src="http://www.google-analytics.com/urchin.js"
type="text/javascript"></script>
<script type="text/javascript">
_uacct = "UA-93213-7";
if (urchinTracker) urchinTracker();
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
MyHeader
</div>

<div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1"
runat="server">
</asp:ContentPlaceHolder>
</div>

<div>
footer
</div>
</form>
</body>
</html>


It place Google Analytics tracking on all the pages, provides a common
header and a common footer.

Here's a page that uses that header:

<%@ Page Language="C#" MasterPageFile="~/MasterPages/SubPages.master"
AutoEventWireup="true"
CodeFile="BlahBlah.aspx.cs" Inherits="BlahBlah" Title="Page Title" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
runat="Server">
My content
</asp:Content>


All in all much much better than mucking with frames :)

Regards,

Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
VetaMcRae
Top