Click here to Skip to main content
15,896,453 members
Articles / Web Development / ASP.NET

Creating a Common Toolbar in ASP.NET 2.0 using MasterPage, Delegate and Events.

Rate me:
Please Sign up or sign in to vote.
4.37/5 (35 votes)
28 Aug 2006CPOL3 min read 121.5K   1.1K   60  
How to create a common toolbar for using with all pages in an asp.net application.
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="ToolBarMasterPage.master.cs" Inherits="ToolBarMasterPage" %>

<!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>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <%--<table cellpadding="0" cellspacing="0" width="100%"><tr style="width:100%;"><td style="width:100%; height: 20px;" align="right">--%>
        <table cellpadding="0" cellspacing="0"  width="100%"><tr>
      <td style="BACKGROUND-COLOR: skyblue; TEXT-ALIGN: center">
          <span style="font-size: 16pt; color: #ffffff"><strong>
          Applcication Header</strong></span><table cellpadding="0" cellspacing="0"  width="100%"><tr>
        <td style="width:82%; height: 20px"></td>
        <td style="background-color:Gray; width:13%; height: 20px">
            <asp:Button ID="btnSave" runat="server" Text="Save" Font-Bold="True" Font-Italic="True" OnClick="btnSave_Click" />
            <asp:Button ID="btnExport" runat="server" Text="Export" Font-Bold="True" Font-Italic="True" OnClick="btnExport_Click" />
            <asp:Button ID="btnPrint" runat="server" Text="Print" Font-Bold="True" Font-Italic="True" OnClick="btnPrint_Click" /></td></tr></table>
          <strong><em>MasterPage Area</em></strong></td></tr>
            </table>
           
      <%--  </td></tr></table>--%>
     
        <asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
       
        </asp:contentplaceholder> <table cellpadding="0" cellspacing="0"  width="100%">
            <tr>
             <td style="BACKGROUND-COLOR: skyblue; TEXT-ALIGN: center">
          <span style="font-size: 11pt; color: #ffffff"><strong>Footer</strong></span></td></tr>
            <tr>
                <td style="height: 19px; background-color: skyblue; text-align: center">
                    <strong><em>MasterPage Area</em></strong></td>
            </tr>
          </table>
    </div>
    </form>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

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


Written By
KPMG
United States United States
My passion is to learn, analyze, design (OOAD), architect, code and work with all team members to create competitive products in the market using efficient ways.

Interested area are .NET, MVC, client-side development, OData, SQL Server BI Solutions( SSAS & SSRS) ,PHP, MySQL, Visual Studio Automation&Performance Testing, Agile development and architect Frameworks and application integration solutions

Comments and Discussions