I have been told that I should add a sidebar to one page of this .net project, but the master page don't include a sidebar. How can I add a sidebar to one page only ?
This is the code for the Master Template, can anyone suggest or help me out here? I'd buy a book and read more, but I have to do this for the next 12 hours.
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Public.master.cs" Inherits="Public" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%--<!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></title>
<%--<link href="favicon.ico" rel="Shortcut Icon" type="image/x-icon" />--%>
<link href="<%= Server.MapPath("~/css/main2.css") %>" rel="stylesheet" type="text/css" media="all" />
<link href="<%= Server.MapPath("~/css/dropdown.css") %>" media="screen" rel="stylesheet" type="text/css" />
<link href="<%= Server.MapPath("~/css/default.advanced.css") %>" media="screen" rel="stylesheet" type="text/css" />
<link href="<%= Server.MapPath("~/css/vlightbox.css") %>" rel="stylesheet" type="text/css" />
<link href="<%= Server.MapPath("~/css/visuallightbox.css") %>" rel="stylesheet" type="text/css" media="screen" />
<link href="<%= Server.MapPath("~/boxes.css") %>"rel="stylesheet" type="text/css" media="screen" />
<script src="<%= Server.MapPath("~/engine/js/jquery.min.js") %>" ype="text/javascript"></script>
<script src="<%= Server.MapPath("~/js/cufon-yui.js") %>" type="text/javascript"></script>
<script src="<%= Server.MapPath("~/js/AFB_400.font.js") %>" type="text/javascript"></script>
<style type="text/css">
#vlightbox a#vlb {
display:none
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.3/jquery-ui.min.js" ></script>
<script type="text/javascript">
Cufon.replace('h2');
</script>
<script type="text/javascript">
Cufon.replace('h3');
</script>
<script type="text/javascript">
Cufon.replace('h5');
</script>
<!--[if IE 8]>
<style type="text/css">
#footer {display:table;}
</style>
<![endif]-->
<style>
ul#nav { width:100%; height:36px; display:block; background-color:#000; background-repeat:repeat-x; }
#wrapthatbanner {display:block; float:left; width:100%; height:529px; margin-left:-20px; margin-bottom:0px; }
</style>
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js?ver=1.3.2'></script>
<script type="text/javascript">
$(document).ready(function() {
$("#footer").stickyFooter();
});
// sticky footer plugin
(function($) {
var footer;
$.fn.extend({
stickyFooter: function(options) {
footer = this;
positionFooter();
$(window)
.scroll(positionFooter)
.resize(positionFooter);
function positionFooter() {
var docHeight = $(document.body).height() - $("#sticky-footer-push").height();
if (docHeight < $(window).height()) {
var diff = $(window).height() - docHeight;
if (!$("#sticky-footer-push").length > 0) {
$(footer).before('<div id="sticky-footer-push"></div>');
}
$("#sticky-footer-push").height(diff);
}
}
}
});
})(jQuery);
</script>
</head>
<body id="@@(categoria)@@">
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" AsyncPostBackTimeout="900"></asp:ScriptManager>
<div id="container">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div id="header">
<div id="headerlink">
<table width="100%" border="0">
<tr>
<td height="77px;" width="67%">
<asp:ImageButton PostBackUrl="~/index.aspx" ImageUrl="~/images/Titulos/5.png" runat="server" alt="" name="screen_logo" width="257" hspace="10" vspace="10" border="0" id="screen_logo" title="" />
</td>
<td valign="top" align="right" width="33%">
<table>
<tr>
<td>
<asp:Label ID="lblFullMessage" Visible="false" runat="server" Font-Size="X-Small" ForeColor="White" Text="Please enter the {0}, {1} and {2} characters from your password."></asp:Label>
</td>
</tr>
<tr valign="middle">
<td>
<img src="../images/login.jpg"</td>
<td valign="top">
开发者_JAVA百科 <asp:TextBox runat="server" Height="16px" Font-Size="Small" ID="txtLogin"
Width="100px"></asp:TextBox>
<asp:Button ID="btnLogin" Height="20px" Font-Size="X-Small" runat="server" Text="Go" OnClick="btnLogin_Click" />
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblError" Visible="false" runat="server" Font-Size="X-Small" ForeColor="Red" Text="Error"></asp:Label>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<ul id="nav" class="dropdown dropdown-horizontal">
<li><asp:HyperLink NavigateUrl="~/index.aspx" CssClass="dir" runat="server" ID="lnk1">Home</asp:HyperLink></li>
<li><asp:HyperLink NavigateUrl="~/PublicSide/link.aspx" CssClass="dir" runat="server" ID="lnk3">link</asp:HyperLink></li>
<li><asp:HyperLink NavigateUrl="~/PublicSide/link.aspx" CssClass="dir" runat="server" ID="lnk4">link</asp:HyperLink></li>
<li><asp:HyperLink NavigateUrl="~/PublicSide/link.aspx" CssClass="dir" runat="server" ID="lnk7">link</asp:HyperLink></li>
<li><asp:HyperLink NavigateUrl="~/PublicSide/link.aspx" CssClass="dir" runat="server" ID="lnk5">link</asp:HyperLink></li>
<li><asp:HyperLink NavigateUrl="~/PublicSide/link.aspx" CssClass="dir" runat="server" ID="lnk2">link</asp:HyperLink></li>
<li><asp:HyperLink NavigateUrl="~/PublicSide/link.aspx" CssClass="dir" runat="server" ID="lnk6">link</asp:HyperLink></li>
</ul>
<div id="wmfg"> </div>
<div id="content"><asp:ContentPlaceHolder ID="Content1" runat="server"> </asp:ContentPlaceHolder></div>
<div id="footer">Footer</div>
</div>
</form>
</body>
</html>
This might be a bit too simple: When adding a new page to the project, select a web form rather than a web content form. That way, you can paste in the above markup without the use of a master page. Or, create a second master page with the sidebar you need, and add a new web content form that uses that second master page.
HTH
精彩评论