如何使用c#.net ...在主页和内容页面中添加页眉和页脚? [英] How to add the Header and footer in master page and content page by using c#.net...?
本文介绍了如何使用c#.net ...在主页和内容页面中添加页眉和页脚?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用c#.net在主页和内容页面中添加页眉和页脚??
我在Header中编写此代码。 ascx但没有得到图像
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
<div class="header">
<img src="Header/header.png" width="998px" height="100px" />
</div>
推荐答案
一个好的解决方案将是要在控件中添加页眉和页脚,然后将控件拖放到母版页中,这就是我使用的内容
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
<%@ 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>
请参阅以下链接
http://www.brainbrushups.com/2013/05/how-to -create-header-and-footer-using.html [ ^ ]
See the following link
http://www.brainbrushups.com/2013/05/how-to-create-header-and-footer-using.html[^]
请参考以下链接http://www.brainbrushups。 com / 2013/05 / how-to-create-header-and-footer-using.html
很清楚如何创建页眉和页脚。 />
您可以设计自己的代码来代替< uc1:header id =Header1runat =serverxmlns:uc1 =#unknown/ >
AND
< uc2:footer id = Footer1runat =serverxmlns:uc2 =#unknown/>
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" />
这篇关于如何使用c#.net ...在主页和内容页面中添加页眉和页脚?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文