Click here to Skip to main content
16,013,820 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,
I am writing a project in ASP>NET,C# that I have a web form named Login.aspx that is not have any Master Page.how can I Attach a master Page for it.
thanks alot
Posted

by adding a web master page to site layout you can add this code..

XML
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Site.master.cs" Inherits="Site" %>
<!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>
 <asp:ContentPlaceHolder id="head" runat="server">
 </asp:ContentPlaceHolder>
</head>
<body>
 <form id="form1" runat="server">
 <div>
 <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">

 </asp:ContentPlaceHolder>
 </div>
 </form>
</body>
</html>
 
Share this answer
 
Comments
gurunbr1 3-Apr-13 9:22am    
you can place the following code to your button click function..
Response.redirect("path of file");
HTML
In the <%page%> tag just add the master page name 
MasterPageFile="~/MasterPage.Master"
Like this..
 
Share this answer
 
v2
ASP.NET
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"></asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"></asp:Content>
 
Share this answer
 
v2

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