OK, following are the fixes:
1. Page Title problem:
If you use Master Pages in Asp.net, you need to set Pate title in each page's Code Behind file, instead of setting the Title in ASPX page. So, here is the things you need to do:
--Remove the following line of code from Default.aspx
<title>Jon's Couch</title>
--Add the following code in the CodeBehind of Default.aspx
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
this.Title = "Jon's Couch";
}
}
Now you will see, page title is correctly appearing in each browser :)
2. Content scrolling down problem:
Basically, you had wrong HTML in MasterPage and Default.aspx. I have corrected those:
Corrected MasterPage code:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!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">
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
<title>Jon's Couch</title>
</head>
<asp:contentplaceholder id="head" runat="server">
</asp:contentplaceholder>
<body>
<form id="form1" runat="server">
<h1>
Jon's Couch
</h1>
<div style="float: left; width: 122px">
<p style="width: 122px; height: 663px; margin-top: 0px; margin-right: 0px;">
<a href="About.aspx">About me</a>
<br />
<a href="Diary.aspx">My diary</a>
<br />
<a href="Articles.aspx">Articles</a>
<br />
<a href="Bookmarks.aspx">My bookmarks</a>
<br />
<a href="Promotions.aspx">Promotions</a>
<br />
<a href="Resume.aspx">My resume</a>
<br />
<a href="Warez.aspx">Filesharing</a>
<br />
</p>
</div>
<div style="float: right">
<asp:ContentPlaceHolder ID="body" runat="server">
</asp:ContentPlaceHolder>
</div>
<div style="clear: both">
</div>
</form>
</body>
</html>
Corrected Default.aspx code:
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" Runat="Server">
This is my webpage, where I write about anything that sparks my interest.
The page is still under construction.
</asp:Content>
3. Gap issue between top and left navigation:
Modify the h1 class in the StyleSheet.css as follows:
h1
{
color:#254117;
background-color:#4AA02C;
text-align:right;
font-family:Arial;
margin:0px;
}
I just added the
"margin:0px" to set the margin of h1 tag to 0px
After doing these modifications, hit
ctrl+f5 to browse the Default.aspx and all your problems will be blown away.
You can have a look at a MasterPage tutorial here at CodeProject (
ASP.NET 2.0 Master Pages[
^])
Don't worry, Asp.net is easy. Enjoy!