Click here to Skip to main content
15,888,733 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to add the Header and footer in master page and content page by using c#.net...?

I am writing this code in "Header.ascx " but not getting the image

XML
<div class="header">
<img src="Header/header.png" width="998px" height="100px" />
</div>
Posted
Comments
ravikiran from Hyderabad 10-Dec-13 5:21am    
mention details clearly ? ? ? ...

A Good solution will be to add header and footer in Controls and drag and drop your controls in master page this is what i have used
ASP.NET
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Front.master.cs" Inherits="Front" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="Control/Footer.ascx" TagName="Footer" TagPrefix="uc1" %>
<%@ Register Src="Control/LeftSection.ascx" TagName="LeftSection" TagPrefix="uc2" %>
<%@ Register Src="Control/Header.ascx" TagName="Header" TagPrefix="uc3" %>
<!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 id="Head1" runat="server">
    
    <link href="Styles/StyleSheet.css" type="text/css" rel="stylesheet" />
    <asp:ContentPlaceHolder ID="cphHead" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" autocomplete="off" runat="server">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    <div id="page_wrapper">
        <uc3:Header ID="Header1"  runat="server" />
        <uc2:LeftSection ID="LeftSection1"  runat="server" />
        <asp:ContentPlaceHolder ID="cphContent" runat="server">
        </asp:ContentPlaceHolder>
        <uc1:Footer ID="Footer1"  runat="server" />
    </div>
    </form>
</body>
</html>
 
Share this answer
 
v2
 
Share this answer
 
Please refer to the following link http://www.brainbrushups.com/2013/05/how-to-create-header-and-footer-using.html"

It is clear how to create header and footer.

U can design ur own code in place of <uc1:header id="Header1" runat="server" xmlns:uc1="#unknown" />

AND

<uc2:footer id="Footer1" runat="server" xmlns:uc2="#unknown" />
 
Share this answer
 
v2
Comments
nandakishoreroyal 10-Dec-13 7:24am    
http://www.brainbrushups.com/2013/05/how-to-create-header-and-footer-using.html

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900