|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Iframe extra spaceAll:
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. 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? 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 Show quoteHide quote "Mike" <indianmostwan***@yahoo.com> wrote in message news:1157505852.305072.317570@i42g2000cwa.googlegroups.com... > 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. >
Other interesting topics
.NET 2005
Master Page prevents using style sheets? Problem with RaiseCallbackEvent 'Could not load file or assembly' every few days - asp.net 1.1 Security exception with impersonate true for a webservice Problems with System.Net.Mail Help debugging...where do I look? making sure page loads Managing Database Connections! Build Failed but no Errors |
|||||||||||||||||||||||