hi every one i m new with ASP .net and I dont know how to create master page with ASP .nethelp me plz
Master Pages allow you to define the look and feel of an entire website. The following links come from Microsoft. Check them out:
From this MSDN page (Walkthrough: Creating and Using ASP.NET Master Pages in Visual Web Developer):
- In Solution Explorer, right-click the name of your Web site, and then click AddNew Item.
- Under Visual Studio installed templates, click Master Page.
- In the Name box, type Master1.
- Select the Place code in separate file check box.
From the creation of a master page offered by Oded, you want to leave the "contentPlaceholders". And you can add more as you see fit. This is the location that your derived pages will make use of.
When you are ready to create a page based on the master page, click to add a new form for your project, click the checkbox to use a "master page", and give it the name of the new form you want to create. When you click OK, it will prompt you for which master page you want it to be based on (you can actually create MANY master pages). Once picked and you are in design mode, it will show you in a greyed out look, the actual content as coming from the "master page", and the content placeholder is where you put your stuff specific to that page. Tables, Grids, labels, whatever. Save and run and you'll see your content. Then, adjust the master page and put something in like a company logo graphic, save and run your second form, you'll see that it will now have the newly added logo.
Hope this clarifies HOW they work... Additionally, you can drag/drop a CSS file onto a master page to apply style formatting across the board too.
this is my master page code
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
Untitled Page
Sign UP